superapp-miniapp-invoke-native 1.11.3 → 1.11.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/main.js CHANGED
@@ -1,4 +1,4 @@
1
- /* eslint-disable no-restricted-globals, no-unused-expressions */
1
+ /* eslint-disable */
2
2
  /* global globalThis, AndroidInitialContext */
3
3
  var kr = Object.defineProperty, br = Object.defineProperties;
4
4
  var Tr = Object.getOwnPropertyDescriptors;
@@ -14,19 +14,19 @@ var ve = (t, e, r) => e in t ? kr(t, e, { enumerable: !0, configurable: !0, writ
14
14
  }, T = (t, e) => br(t, Tr(e));
15
15
  var P = (t, e, r) => (ve(t, typeof e != "symbol" ? e + "" : e, r), r);
16
16
  var o = (t, e, r) => new Promise((n, a) => {
17
- var i = (d) => {
17
+ var i = (l) => {
18
18
  try {
19
- s(r.next(d));
19
+ s(r.next(l));
20
20
  } catch (u) {
21
21
  a(u);
22
22
  }
23
- }, c = (d) => {
23
+ }, c = (l) => {
24
24
  try {
25
- s(r.throw(d));
25
+ s(r.throw(l));
26
26
  } catch (u) {
27
27
  a(u);
28
28
  }
29
- }, s = (d) => d.done ? n(d.value) : Promise.resolve(d.value).then(i, c);
29
+ }, s = (l) => l.done ? n(l.value) : Promise.resolve(l.value).then(i, c);
30
30
  s((r = r.apply(t, e)).next());
31
31
  });
32
32
  /*! Capacitor: https://capacitorjs.com/ - MIT License */
@@ -51,7 +51,7 @@ class Ae extends Error {
51
51
  }
52
52
  const Fr = (t) => {
53
53
  var e, r, n, a, i;
54
- const c = t.CapacitorCustomPlatform || null, s = t.Capacitor || {}, d = s.Plugins = s.Plugins || {}, u = t.CapacitorPlatforms, _ = ((e = u == null ? void 0 : u.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || (() => c !== null ? c.name : ((h) => {
54
+ const c = t.CapacitorCustomPlatform || null, s = t.Capacitor || {}, l = s.Plugins = s.Plugins || {}, u = t.CapacitorPlatforms, _ = ((e = u == null ? void 0 : u.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || (() => c !== null ? c.name : ((h) => {
55
55
  var m, N;
56
56
  return h != null && h.androidBridge ? "android" : !((N = (m = h == null ? void 0 : h.webkit) === null || m === void 0 ? void 0 : m.messageHandlers) === null || N === void 0) && N.bridge ? "ios" : "web";
57
57
  })(t)), p = ((r = u == null ? void 0 : u.currentPlatform) === null || r === void 0 ? void 0 : r.isNativePlatform) || (() => _() !== "web"), f = ((n = u == null ? void 0 : u.currentPlatform) === null || n === void 0 ? void 0 : n.isPluginAvailable) || ((h) => {
@@ -68,11 +68,11 @@ const Fr = (t) => {
68
68
  let k;
69
69
  const Me = (L) => {
70
70
  let R;
71
- const x = (...Y) => {
71
+ const D = (...Y) => {
72
72
  const q = (() => o(void 0, null, function* () {
73
73
  return !k && v in m ? k = k = typeof m[v] == "function" ? yield m[v]() : m[v] : c !== null && !k && "web" in m && (k = k = typeof m.web == "function" ? yield m.web() : m.web), k;
74
74
  }))().then((K) => {
75
- const De = ((A, z) => {
75
+ const xe = ((A, z) => {
76
76
  var Ie, Ce;
77
77
  if (!$) {
78
78
  if (A)
@@ -80,15 +80,15 @@ const Fr = (t) => {
80
80
  throw new Ae(`"${h}" plugin is not implemented on ${v}`, j.Unimplemented);
81
81
  }
82
82
  {
83
- const xe = $ == null ? void 0 : $.methods.find((G) => z === G.name);
84
- if (xe)
85
- return xe.rtype === "promise" ? (G) => s.nativePromise(h, z.toString(), G) : (G, Rr) => s.nativeCallback(h, z.toString(), G, Rr);
83
+ const De = $ == null ? void 0 : $.methods.find((G) => z === G.name);
84
+ if (De)
85
+ return De.rtype === "promise" ? (G) => s.nativePromise(h, z.toString(), G) : (G, Rr) => s.nativeCallback(h, z.toString(), G, Rr);
86
86
  if (A)
87
87
  return (Ie = A[z]) === null || Ie === void 0 ? void 0 : Ie.bind(A);
88
88
  }
89
89
  })(K, L);
90
- if (De) {
91
- const A = De(...Y);
90
+ if (xe) {
91
+ const A = xe(...Y);
92
92
  return R = A == null ? void 0 : A.remove, A;
93
93
  }
94
94
  throw new Ae(`"${h}.${L}()" is not implemented on ${v}`, j.Unimplemented);
@@ -97,12 +97,12 @@ const Fr = (t) => {
97
97
  return R();
98
98
  })), q;
99
99
  };
100
- return x.toString = () => `${L.toString()}() { [capacitor code] }`, Object.defineProperty(x, "name", { value: L, writable: !1, configurable: !1 }), x;
100
+ return D.toString = () => `${L.toString()}() { [capacitor code] }`, Object.defineProperty(D, "name", { value: L, writable: !1, configurable: !1 }), D;
101
101
  }, Ue = Me("addListener"), We = Me("removeListener"), Er = (L, R) => {
102
- const x = Ue({ eventName: L }, R), Y = () => o(void 0, null, function* () {
103
- const K = yield x;
102
+ const D = Ue({ eventName: L }, R), Y = () => o(void 0, null, function* () {
103
+ const K = yield D;
104
104
  We({ eventName: L, callbackId: K }, R);
105
- }), q = new Promise((K) => x.then(() => K({ remove: Y })));
105
+ }), q = new Promise((K) => D.then(() => K({ remove: Y })));
106
106
  return q.remove = () => o(void 0, null, function* () {
107
107
  console.warn("Using addListener() without 'await' is deprecated."), yield Y();
108
108
  }), q;
@@ -120,11 +120,11 @@ const Fr = (t) => {
120
120
  return Me(R);
121
121
  }
122
122
  } });
123
- return d[h] = fe, I.set(h, { name: h, proxy: fe, platforms: /* @__PURE__ */ new Set([...Object.keys(m), ...$ ? [v] : []]) }), fe;
123
+ return l[h] = fe, I.set(h, { name: h, proxy: fe, platforms: /* @__PURE__ */ new Set([...Object.keys(m), ...$ ? [v] : []]) }), fe;
124
124
  });
125
125
  return s.convertFileSrc || (s.convertFileSrc = (h) => h), s.getPlatform = _, s.handleError = (h) => t.console.error(h), s.isNativePlatform = p, s.isPluginAvailable = f, s.pluginMethodNoop = (h, m, N) => Promise.reject(`${N} does not have an implementation of "${m}".`), s.registerPlugin = C, s.Exception = Ae, s.DEBUG = !!s.DEBUG, s.isLoggingEnabled = !!s.isLoggingEnabled, s.platform = s.getPlatform(), s.isNative = s.isNativePlatform(), s;
126
- }, Ur = (t) => t.Capacitor = Fr(t), w = Ur(typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : typeof global != "undefined" ? global : {}), Fe = w.registerPlugin;
127
- w.Plugins;
126
+ }, Ur = (t) => t.Capacitor = Fr(t), d = Ur(typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : typeof global != "undefined" ? global : {}), Fe = d.registerPlugin;
127
+ d.Plugins;
128
128
  class y {
129
129
  constructor(e) {
130
130
  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);
@@ -161,10 +161,10 @@ class y {
161
161
  } };
162
162
  }
163
163
  unimplemented(e = "not implemented") {
164
- return new w.Exception(e, j.Unimplemented);
164
+ return new d.Exception(e, j.Unimplemented);
165
165
  }
166
166
  unavailable(e = "not available") {
167
- return new w.Exception(e, j.Unavailable);
167
+ return new d.Exception(e, j.Unavailable);
168
168
  }
169
169
  removeListener(e, r) {
170
170
  return o(this, null, function* () {
@@ -236,10 +236,10 @@ class Wr extends y {
236
236
  }
237
237
  }
238
238
  Fe("CapacitorCookies", { web: () => new Wr() });
239
- const Dr = (t, e = {}) => {
239
+ const xr = (t, e = {}) => {
240
240
  const r = Object.assign({ method: t.method || "GET", headers: t.headers }, e), n = ((a = {}) => {
241
241
  const i = Object.keys(a);
242
- return Object.keys(a).map((c) => c.toLocaleLowerCase()).reduce((c, s, d) => (c[s] = a[i[d]], c), {});
242
+ return Object.keys(a).map((c) => c.toLocaleLowerCase()).reduce((c, s, l) => (c[s] = a[i[l]], c), {});
243
243
  })(t.headers)["content-type"] || "";
244
244
  if (typeof t.data == "string")
245
245
  r.body = t.data;
@@ -264,21 +264,21 @@ const Dr = (t, e = {}) => {
264
264
  (n.includes("application/json") || typeof t.data == "object") && (r.body = JSON.stringify(t.data));
265
265
  return r;
266
266
  };
267
- class xr extends y {
267
+ class Dr extends y {
268
268
  request(e) {
269
269
  return o(this, null, function* () {
270
- const r = Dr(e, e.webFetchExtra), n = ((p, f = !0) => p ? Object.entries(p).reduce((O, I) => {
270
+ const r = xr(e, e.webFetchExtra), n = ((p, f = !0) => p ? Object.entries(p).reduce((O, I) => {
271
271
  const [C, h] = I;
272
272
  let m, N;
273
273
  return Array.isArray(h) ? (N = "", h.forEach((v) => {
274
274
  m = f ? encodeURIComponent(v) : v, N += `${C}=${m}&`;
275
275
  }), N.slice(0, -1)) : (m = f ? encodeURIComponent(h) : h, N = `${C}=${m}`), `${O}&${N}`;
276
276
  }, "").substr(1) : null)(e.params, e.shouldEncodeUrlParams), a = n ? `${e.url}?${n}` : e.url, i = yield fetch(a, r), c = i.headers.get("content-type") || "";
277
- let s, d, { responseType: u = "text" } = i.ok ? e : {};
277
+ let s, l, { responseType: u = "text" } = i.ok ? e : {};
278
278
  switch (c.includes("application/json") && (u = "json"), u) {
279
279
  case "arraybuffer":
280
280
  case "blob":
281
- d = yield i.blob(), s = yield ((p) => o(this, null, function* () {
281
+ l = yield i.blob(), s = yield ((p) => o(this, null, function* () {
282
282
  return new Promise((f, O) => {
283
283
  const I = new FileReader();
284
284
  I.onload = () => {
@@ -286,7 +286,7 @@ class xr extends y {
286
286
  f(C.indexOf(",") >= 0 ? C.split(",")[1] : C);
287
287
  }, I.onerror = (C) => O(C), I.readAsDataURL(p);
288
288
  });
289
- }))(d);
289
+ }))(l);
290
290
  break;
291
291
  case "json":
292
292
  s = yield i.json();
@@ -327,9 +327,9 @@ class xr extends y {
327
327
  }
328
328
  }
329
329
  function Oe() {
330
- return w.getPlatform() === "android" ? JSON.parse(AndroidInitialContext.initialContext()) : window.portalInitialContext;
330
+ return d.getPlatform() === "android" ? JSON.parse(AndroidInitialContext.initialContext()) : window.portalInitialContext;
331
331
  }
332
- Fe("CapacitorHttp", { web: () => new xr() }), /*! Ionic Portals: https://ionic.io/portals - Commercial License */
332
+ Fe("CapacitorHttp", { web: () => new Dr() }), /*! Ionic Portals: https://ionic.io/portals - Commercial License */
333
333
  Fe("Portals", { web: () => Promise.resolve().then(function() {
334
334
  return jr;
335
335
  }).then((t) => new t.PortalsWeb()) });
@@ -437,7 +437,7 @@ const M = () => {
437
437
  } catch (t) {
438
438
  throw console.error("isWinHandle error", t), t;
439
439
  }
440
- }, E = "CommunicatePlugin", g = w.registerPlugin(E, { web: () => Promise.resolve().then(() => mt).then((t) => new t.PluginsWeb()) }), re = M();
440
+ }, E = "CommunicatePlugin", g = d.registerPlugin(E, { web: () => Promise.resolve().then(() => gt).then((t) => new t.PluginsWeb()) }), re = M();
441
441
  re.removeAddListenerFab = () => null;
442
442
  const qr = (t, e) => {
443
443
  var r, n;
@@ -447,8 +447,8 @@ const qr = (t, e) => {
447
447
  if ((r = g.showFABMenu) == null || r.call(g, { fabMenu: a, position: null }), !t || !((n = Object.keys(t)) != null && n.length))
448
448
  return;
449
449
  Object.keys(t).forEach((i) => {
450
- var c, s, d, u, _, p, f, O;
451
- a.push({ disable: (s = (c = t == null ? void 0 : t[i]) == null ? void 0 : c.disable) != null ? s : !1, icon: (u = (d = t == null ? void 0 : t[i]) == null ? void 0 : d.icon) != null ? u : "", id: (p = (_ = t == null ? void 0 : t[i]) == null ? void 0 : _.id) != null ? p : "", name: (O = (f = t == null ? void 0 : t[i]) == null ? void 0 : f.title) != null ? O : "" });
450
+ var c, s, l, u, _, p, f, O;
451
+ a.push({ disable: (s = (c = t == null ? void 0 : t[i]) == null ? void 0 : c.disable) != null ? s : !1, icon: (u = (l = t == null ? void 0 : t[i]) == null ? void 0 : l.icon) != null ? u : "", id: (p = (_ = t == null ? void 0 : t[i]) == null ? void 0 : _.id) != null ? p : "", name: (O = (f = t == null ? void 0 : t[i]) == null ? void 0 : f.title) != null ? O : "" });
452
452
  }), queueMicrotask(() => {
453
453
  var i;
454
454
  (i = g.showFABMenu) == null || i.call(g, { fabMenu: a, position: e != null ? e : null });
@@ -456,8 +456,8 @@ const qr = (t, e) => {
456
456
  ((i) => o(void 0, null, function* () {
457
457
  i && (re.removeAddListenerFab = yield ((c) => o(void 0, null, function* () {
458
458
  try {
459
- if (w.addListener) {
460
- const s = yield w.addListener(E, "nativeSendFab", (d) => c && c(d));
459
+ if (d.addListener) {
460
+ const s = yield d.addListener(E, "nativeSendFab", (l) => c && c(l));
461
461
  return s != null && s.remove ? s.remove : () => null;
462
462
  }
463
463
  } catch (s) {
@@ -467,8 +467,8 @@ const qr = (t, e) => {
467
467
  }))((i) => {
468
468
  let c;
469
469
  i != null && i.disable || i != null && i.id && (Object.keys(t).forEach((s) => {
470
- var d, u, _;
471
- (d = t == null ? void 0 : t[s]) != null && d.id && i.id === t[s].id && (c = (_ = (u = t[s]) == null ? void 0 : u.fn) != null ? _ : () => null);
470
+ var l, u, _;
471
+ (l = t == null ? void 0 : t[s]) != null && l.id && i.id === t[s].id && (c = (_ = (u = t[s]) == null ? void 0 : u.fn) != null ? _ : () => null);
472
472
  }), typeof c == "function" && c());
473
473
  });
474
474
  });
@@ -481,8 +481,8 @@ const ze = (t = () => null) => o(void 0, null, function* () {
481
481
  try {
482
482
  B != null && B.addListenerBackRemoveHandle && typeof B.addListenerBackRemoveHandle == "function" && B.addListenerBackRemoveHandle(), B.addListenerBackRemoveHandle = yield ((e) => o(void 0, null, function* () {
483
483
  try {
484
- if (w.addListener) {
485
- const r = yield w.addListener(E, "nativeSendBack", (n) => e && e(n));
484
+ if (d.addListener) {
485
+ const r = yield d.addListener(E, "nativeSendBack", (n) => e && e(n));
486
486
  return r != null && r.remove ? r.remove : () => null;
487
487
  }
488
488
  } catch (r) {
@@ -500,8 +500,8 @@ const Kr = (t) => {
500
500
  ((e) => o(void 0, null, function* () {
501
501
  e && (te.addListenerHomeHandle = yield ((r) => o(void 0, null, function* () {
502
502
  try {
503
- if (w.addListener) {
504
- const n = yield w.addListener(E, "nativeSendHome", (a) => r && r(a));
503
+ if (d.addListener) {
504
+ const n = yield d.addListener(E, "nativeSendHome", (a) => r && r(a));
505
505
  return n != null && n.remove ? n.remove : () => null;
506
506
  }
507
507
  } catch (n) {
@@ -519,8 +519,8 @@ const Ge = (t = () => null) => o(void 0, null, function* () {
519
519
  try {
520
520
  V != null && V.addListenerTouchRemoveHandle && typeof V.addListenerTouchRemoveHandle == "function" && V.addListenerTouchRemoveHandle(), V.addListenerTouchRemoveHandle = yield ((e) => o(void 0, null, function* () {
521
521
  try {
522
- if (w.addListener) {
523
- const r = yield w.addListener(E, "nativeTouchListener", (n) => e && e(n));
522
+ if (d.addListener) {
523
+ const r = yield d.addListener(E, "nativeTouchListener", (n) => e && e(n));
524
524
  return r != null && r.remove ? r.remove : () => null;
525
525
  }
526
526
  } catch (r) {
@@ -538,8 +538,8 @@ const Je = (t = () => null) => o(void 0, null, function* () {
538
538
  try {
539
539
  if (window.__MICRO_APP_ENVIRONMENT__)
540
540
  return e && window.rawWindow.__mini_app_hook__.getDeeplinkParams(e), { remove: () => null };
541
- if (w.addListener) {
542
- const r = yield w.addListener(E, "nativeSendDeeplinkCallbackListener", (n) => e && e(n));
541
+ if (d.addListener) {
542
+ const r = yield d.addListener(E, "nativeSendDeeplinkCallbackListener", (n) => e && e(n));
543
543
  return r != null && r.remove ? r.remove : () => null;
544
544
  }
545
545
  } catch (r) {
@@ -555,8 +555,8 @@ const Qe = (t = () => null) => o(void 0, null, function* () {
555
555
  try {
556
556
  F != null && F.addListenerSwitchLanguageRemoveHandle && typeof F.addListenerSwitchLanguageRemoveHandle == "function" && F.addListenerSwitchLanguageRemoveHandle(), F.addListenerSwitchLanguageRemoveHandle = yield ((e) => o(void 0, null, function* () {
557
557
  try {
558
- if (w.addListener) {
559
- const r = yield w.addListener(E, "nativeSendSwitchLanguage", (n) => e && e(n));
558
+ if (d.addListener) {
559
+ const r = yield d.addListener(E, "nativeSendSwitchLanguage", (n) => e && e(n));
560
560
  return r != null && r.remove ? r.remove : () => null;
561
561
  }
562
562
  if (window.__MICRO_APP_ENVIRONMENT__)
@@ -576,8 +576,8 @@ const Ye = (t = () => null) => o(void 0, null, function* () {
576
576
  try {
577
577
  U != null && U.addListenerSetupMiniAppRemoveHandle && typeof U.addListenerSetupMiniAppRemoveHandle == "function" && U.addListenerSetupMiniAppRemoveHandle(), U.addListenerSetupMiniAppRemoveHandle = yield ((e) => o(void 0, null, function* () {
578
578
  try {
579
- if (w.addListener) {
580
- const r = yield w.addListener(E, "nativeSetupMiniApp", (n) => e && e(n));
579
+ if (d.addListener) {
580
+ const r = yield d.addListener(E, "nativeSetupMiniApp", (n) => e && e(n));
581
581
  return r != null && r.remove ? r.remove : () => null;
582
582
  }
583
583
  } catch (r) {
@@ -593,8 +593,8 @@ const Ze = (t = () => null) => o(void 0, null, function* () {
593
593
  try {
594
594
  W != null && W.addListenerSwitchStoreRemoveHandle && typeof W.addListenerSwitchStoreRemoveHandle == "function" && W.addListenerSwitchStoreRemoveHandle(), W.addListenerSwitchStoreRemoveHandle = yield ((e) => o(void 0, null, function* () {
595
595
  try {
596
- if (w.addListener) {
597
- const r = yield w.addListener(E, "nativeSendSwitchStore", (n) => e && e(n));
596
+ if (d.addListener) {
597
+ const r = yield d.addListener(E, "nativeSendSwitchStore", (n) => e && e(n));
598
598
  return r != null && r.remove ? r.remove : () => null;
599
599
  }
600
600
  if (window.__MICRO_APP_ENVIRONMENT__)
@@ -866,7 +866,7 @@ class zr {
866
866
  let ne = null;
867
867
  var sr;
868
868
  window.__MICRO_APP_ENVIRONMENT__ && (ne = (sr = window.rawWindow.__mini_app_status_hook__) != null ? sr : {});
869
- const Le = w.registerPlugin("CameraScanPlugin", { web: new class extends y {
869
+ const Le = d.registerPlugin("CameraScanPlugin", { web: new class extends y {
870
870
  pickCameraScan(t) {
871
871
  return o(this, null, function* () {
872
872
  return new Promise((e) => {
@@ -924,7 +924,7 @@ class Gr {
924
924
  let oe = null;
925
925
  var cr;
926
926
  window.__MICRO_APP_ENVIRONMENT__ && (oe = (cr = window.rawWindow.__mini_app_status_hook__) != null ? cr : {});
927
- const Ee = w.registerPlugin("CameraScanMultiplePlugin", { web: new class extends y {
927
+ const Ee = d.registerPlugin("CameraScanMultiplePlugin", { web: new class extends y {
928
928
  pickCameraScanMultiple() {
929
929
  return o(this, null, function* () {
930
930
  });
@@ -978,7 +978,7 @@ class Jr {
978
978
  let ae = null;
979
979
  var lr;
980
980
  window.__MICRO_APP_ENVIRONMENT__ && (ae = (lr = window.rawWindow.__mini_app_status_hook__) != null ? lr : {});
981
- const Re = w.registerPlugin("CameraScanMultipleNoCountPlugin", { web: new class extends y {
981
+ const Re = d.registerPlugin("CameraScanMultipleNoCountPlugin", { web: new class extends y {
982
982
  pickCameraScanMultipleNoCount() {
983
983
  return o(this, null, function* () {
984
984
  });
@@ -1032,7 +1032,7 @@ class Qr {
1032
1032
  let ie = null;
1033
1033
  var wr;
1034
1034
  window.__MICRO_APP_ENVIRONMENT__ && (ie = (wr = window.rawWindow.__mini_app_status_hook__) != null ? wr : {});
1035
- const ke = w.registerPlugin("CameraScanSingleOrDualPlugin", { web: new class extends y {
1035
+ const ke = d.registerPlugin("CameraScanSingleOrDualPlugin", { web: new class extends y {
1036
1036
  pickCameraScanSingleOrDual() {
1037
1037
  return o(this, null, function* () {
1038
1038
  });
@@ -1087,7 +1087,7 @@ const Ir = "LaserScanPlugin";
1087
1087
  let se = null;
1088
1088
  var dr;
1089
1089
  window.__MICRO_APP_ENVIRONMENT__ && (se = (dr = window.rawWindow.__mini_app_status_hook__) != null ? dr : {});
1090
- const Z = w.registerPlugin(Ir, { web: new class extends y {
1090
+ const Z = d.registerPlugin(Ir, { web: new class extends y {
1091
1091
  pickLaserScan() {
1092
1092
  return o(this, null, function* () {
1093
1093
  });
@@ -1120,8 +1120,8 @@ const Xe = (t = () => null) => {
1120
1120
  const e = (r) => o(void 0, null, function* () {
1121
1121
  r && (ce.removeAddListenerLaserScan = yield ((n) => o(void 0, null, function* () {
1122
1122
  try {
1123
- if (w.addListener) {
1124
- const a = yield w.addListener(Ir, "nativeSendLaser", (i) => n && n(i));
1123
+ if (d.addListener) {
1124
+ const a = yield d.addListener(Ir, "nativeSendLaser", (i) => n && n(i));
1125
1125
  return a != null && a.remove ? a.remove : () => null;
1126
1126
  }
1127
1127
  } catch (a) {
@@ -1193,7 +1193,7 @@ const Cr = "CountAssistPlugin";
1193
1193
  let le = null;
1194
1194
  var ur;
1195
1195
  window.__MICRO_APP_ENVIRONMENT__ && (le = (ur = window.rawWindow.__mini_app_status_hook__) != null ? ur : {});
1196
- const X = w.registerPlugin(Cr, { web: new class extends y {
1196
+ const X = d.registerPlugin(Cr, { web: new class extends y {
1197
1197
  setCountAssistState(t) {
1198
1198
  return o(this, null, function* () {
1199
1199
  try {
@@ -1239,14 +1239,14 @@ const X = w.registerPlugin(Cr, { web: new class extends y {
1239
1239
  throw console.error("countAssist getStatus error", t), t;
1240
1240
  }
1241
1241
  }
1242
- }() }), D = M();
1243
- D.addListenerCountAssistRemoveHandle = () => null;
1242
+ }() }), x = M();
1243
+ x.addListenerCountAssistRemoveHandle = () => null;
1244
1244
  const er = (t = () => null) => o(void 0, null, function* () {
1245
1245
  try {
1246
- D != null && D.addListenerCountAssistRemoveHandle && typeof D.addListenerCountAssistRemoveHandle == "function" && D.addListenerCountAssistRemoveHandle(), D.addListenerCountAssistRemoveHandle = yield ((e) => o(void 0, null, function* () {
1246
+ x != null && x.addListenerCountAssistRemoveHandle && typeof x.addListenerCountAssistRemoveHandle == "function" && x.addListenerCountAssistRemoveHandle(), x.addListenerCountAssistRemoveHandle = yield ((e) => o(void 0, null, function* () {
1247
1247
  try {
1248
- if (w.addListener) {
1249
- const r = yield w.addListener(Cr, "nativeSendCountAssist", (n) => e && e(n));
1248
+ if (d.addListener) {
1249
+ const r = yield d.addListener(Cr, "nativeSendCountAssist", (n) => e && e(n));
1250
1250
  return r != null && r.remove ? r.remove : () => null;
1251
1251
  }
1252
1252
  } catch (r) {
@@ -1312,7 +1312,7 @@ class Xr {
1312
1312
  let we = null;
1313
1313
  var _r;
1314
1314
  window.__MICRO_APP_ENVIRONMENT__ && (we = (_r = window.rawWindow.__mini_app_status_hook__) != null ? _r : {});
1315
- const be = w.registerPlugin("ClickStreamPlugin", { web: new class extends y {
1315
+ const be = d.registerPlugin("ClickStreamPlugin", { web: new class extends y {
1316
1316
  init() {
1317
1317
  return o(this, null, function* () {
1318
1318
  return new Promise((t) => {
@@ -1382,7 +1382,7 @@ let de = null;
1382
1382
  var hr;
1383
1383
  window.__MICRO_APP_ENVIRONMENT__ && (de = (hr = window.rawWindow.__mini_app_status_hook__) != null ? hr : {});
1384
1384
  var J = ((t) => (t.MINI_APP_BEFORE_UNMOUNT_PERMISSION = "mini_app_before_unmount_permission", t.MINI_APP_BEFORE_UNMOUNT_COMPLETION = "mini_app_before_unmount_completion", t))(J || {});
1385
- const Te = w.registerPlugin(vr, { web: new class extends y {
1385
+ const Te = d.registerPlugin(vr, { web: new class extends y {
1386
1386
  setNativeUsagePermission() {
1387
1387
  return o(this, null, function* () {
1388
1388
  });
@@ -1411,8 +1411,8 @@ const rr = (t = () => null) => {
1411
1411
  const e = (r) => o(void 0, null, function* () {
1412
1412
  r && (ue.removeAddListenerLifecycleMiniAppBeforeUnmount = yield ((n) => o(void 0, null, function* () {
1413
1413
  try {
1414
- if (w.addListener) {
1415
- const a = yield w.addListener(vr, "miniAppBeforeUnmount", (i) => n && n(i));
1414
+ if (d.addListener) {
1415
+ const a = yield d.addListener(vr, "miniAppBeforeUnmount", (i) => n && n(i));
1416
1416
  return a != null && a.remove ? a.remove : () => null;
1417
1417
  }
1418
1418
  } catch (a) {
@@ -1454,10 +1454,10 @@ class rt {
1454
1454
  const { mounted: a, beforeUnmount: i, callBack: c } = r;
1455
1455
  a(() => {
1456
1456
  rr((s) => o(this, null, function* () {
1457
- var d;
1457
+ var l;
1458
1458
  if (c && c instanceof Function)
1459
1459
  try {
1460
- (d = c(s)) == null || d.then(() => o(this, null, function* () {
1460
+ (l = c(s)) == null || l.then(() => o(this, null, function* () {
1461
1461
  yield n.setNativeUsagePermission({ action: J.MINI_APP_BEFORE_UNMOUNT_PERMISSION, value: !1 }), yield n.authorizeWebCallback({ action: J.MINI_APP_BEFORE_UNMOUNT_COMPLETION });
1462
1462
  }));
1463
1463
  } catch (u) {
@@ -1487,7 +1487,7 @@ class rt {
1487
1487
  let _e = null;
1488
1488
  var pr;
1489
1489
  window.__MICRO_APP_ENVIRONMENT__ && (_e = (pr = window.rawWindow.__mini_app_status_hook__) != null ? pr : {});
1490
- const Be = w.registerPlugin("DeviceInteractionPlugin", { web: new class extends y {
1490
+ const Be = d.registerPlugin("DeviceInteractionPlugin", { web: new class extends y {
1491
1491
  callVibrate() {
1492
1492
  return o(this, null, function* () {
1493
1493
  });
@@ -1542,7 +1542,7 @@ const Ar = "PollingPlugin";
1542
1542
  let he = null;
1543
1543
  var mr;
1544
1544
  window.__MICRO_APP_ENVIRONMENT__ && (he = (mr = window.rawWindow.__mini_app_status_hook__) != null ? mr : {});
1545
- const Ve = w.registerPlugin(Ar, { web: new class extends y {
1545
+ const Ve = d.registerPlugin(Ar, { web: new class extends y {
1546
1546
  create() {
1547
1547
  return o(this, null, function* () {
1548
1548
  });
@@ -1572,8 +1572,8 @@ const nt = (t, e) => {
1572
1572
  ((n) => o(void 0, null, function* () {
1573
1573
  return n && (pe.removeAddListenerPolling = yield ((a) => o(void 0, null, function* () {
1574
1574
  try {
1575
- if (w.addListener) {
1576
- const i = yield w.addListener(Ar, "nativeSendPolling", (c) => a && a(c));
1575
+ if (d.addListener) {
1576
+ const i = yield d.addListener(Ar, "nativeSendPolling", (c) => a && a(c));
1577
1577
  return i != null && i.remove ? i.remove : () => null;
1578
1578
  }
1579
1579
  } catch (i) {
@@ -1599,21 +1599,21 @@ class ot {
1599
1599
  if (window.__MICRO_APP_ENVIRONMENT__) {
1600
1600
  const { mounted: i, pollingParams: c, callBack: s } = e;
1601
1601
  return i(() => {
1602
- var d, u;
1603
- (u = (d = window.rawWindow.__mini_app_hook__) == null ? void 0 : d.addPolling) == null || u.call(d, c, s);
1602
+ var l, u;
1603
+ (u = (l = window.rawWindow.__mini_app_hook__) == null ? void 0 : l.addPolling) == null || u.call(l, c, s);
1604
1604
  }), () => {
1605
1605
  this.destroy({ pollingId: c.pollingId });
1606
1606
  };
1607
1607
  }
1608
1608
  try {
1609
- (r = e == null ? void 0 : e.pollingParams) != null && r.pollingId && this.pollingList.push({ pollingId: (n = e == null ? void 0 : e.pollingParams) == null ? void 0 : n.pollingId, callBack: e == null ? void 0 : e.callBack }), this.pollingList = this.pollingList.filter((c, s, d) => s === d.findIndex((u) => u.pollingId === c.pollingId));
1609
+ (r = e == null ? void 0 : e.pollingParams) != null && r.pollingId && this.pollingList.push({ pollingId: (n = e == null ? void 0 : e.pollingParams) == null ? void 0 : n.pollingId, callBack: e == null ? void 0 : e.callBack }), this.pollingList = this.pollingList.filter((c, s, l) => s === l.findIndex((u) => u.pollingId === c.pollingId));
1610
1610
  const i = ((a = e == null ? void 0 : e.pollingParams) == null ? void 0 : a.delay) / 1e3;
1611
1611
  return Ve.create(T(b({}, e == null ? void 0 : e.pollingParams), { delay: i })), ((c, s) => {
1612
1612
  try {
1613
- const { mounted: d, pollingParams: u } = c;
1614
- d(() => nt(s, u));
1615
- } catch (d) {
1616
- throw console.error("createPolling error", d), d;
1613
+ const { mounted: l, pollingParams: u } = c;
1614
+ l(() => nt(s, u));
1615
+ } catch (l) {
1616
+ throw console.error("createPolling error", l), l;
1617
1617
  }
1618
1618
  })(e, this), () => {
1619
1619
  var c, s;
@@ -1649,7 +1649,7 @@ class ot {
1649
1649
  let me = null;
1650
1650
  var gr;
1651
1651
  window.__MICRO_APP_ENVIRONMENT__ && (me = (gr = window.rawWindow.__mini_app_status_hook__) != null ? gr : {});
1652
- const tr = w.registerPlugin("PaymentPlugin", { web: new class extends y {
1652
+ const tr = d.registerPlugin("PaymentPlugin", { web: new class extends y {
1653
1653
  process(t) {
1654
1654
  return o(this, null, function* () {
1655
1655
  try {
@@ -1697,7 +1697,7 @@ class at {
1697
1697
  let ge = null;
1698
1698
  var Pr;
1699
1699
  window.__MICRO_APP_ENVIRONMENT__ && (ge = (Pr = window.rawWindow.__mini_app_status_hook__) != null ? Pr : {});
1700
- const He = w.registerPlugin("CameraForTakePhotoPlugin", { web: new class extends y {
1700
+ const He = d.registerPlugin("CameraForTakePhotoPlugin", { web: new class extends y {
1701
1701
  pickCameraForTakePhoto() {
1702
1702
  return o(this, null, function* () {
1703
1703
  });
@@ -1751,7 +1751,7 @@ class it {
1751
1751
  let Pe = null;
1752
1752
  var yr;
1753
1753
  window.__MICRO_APP_ENVIRONMENT__ && (Pe = (yr = window.rawWindow.__mini_app_status_hook__) != null ? yr : {});
1754
- const nr = w.registerPlugin("HttpPlugin", { web: new class extends y {
1754
+ const nr = d.registerPlugin("HttpPlugin", { web: new class extends y {
1755
1755
  request(t) {
1756
1756
  return o(this, null, function* () {
1757
1757
  return new Promise((e) => {
@@ -1803,9 +1803,9 @@ for (let t = 0; t < 256; ++t)
1803
1803
  const ct = new Uint8Array(16);
1804
1804
  function lt(t, e, r) {
1805
1805
  return e || t || !crypto.randomUUID ? function(n, a, i) {
1806
- var s, d, u;
1806
+ var s, l, u;
1807
1807
  n = n || {};
1808
- const c = (u = (d = n.random) != null ? d : (s = n.rng) == null ? void 0 : s.call(n)) != null ? u : crypto.getRandomValues(ct);
1808
+ const c = (u = (l = n.random) != null ? l : (s = n.rng) == null ? void 0 : s.call(n)) != null ? u : crypto.getRandomValues(ct);
1809
1809
  if (c.length < 16)
1810
1810
  throw new Error("Random bytes length must be >= 16");
1811
1811
  if (c[6] = 15 & c[6] | 64, c[8] = 63 & c[8] | 128, a) {
@@ -1824,7 +1824,7 @@ const Or = "PrintPlugin";
1824
1824
  let ye = null;
1825
1825
  var Sr;
1826
1826
  window.__MICRO_APP_ENVIRONMENT__ && (ye = (Sr = window.rawWindow.__mini_app_status_hook__) != null ? Sr : {});
1827
- const or = w.registerPlugin(Or, { web: new class extends y {
1827
+ const or = d.registerPlugin(Or, { web: new class extends y {
1828
1828
  print() {
1829
1829
  }
1830
1830
  getStatus() {
@@ -1848,8 +1848,8 @@ const wt = (t, e) => {
1848
1848
  } }), ((n) => o(void 0, null, function* () {
1849
1849
  return n && (Q.removeAddListenerPrintList[r] = yield ((a) => o(void 0, null, function* () {
1850
1850
  try {
1851
- if (w.addListener) {
1852
- const i = yield w.addListener(Or, "nativeSendPrint", (c) => a && a(c));
1851
+ if (d.addListener) {
1852
+ const i = yield d.addListener(Or, "nativeSendPrint", (c) => a && a(c));
1853
1853
  return i != null && i.remove ? i.remove : () => null;
1854
1854
  }
1855
1855
  } catch (i) {
@@ -1874,15 +1874,15 @@ class dt {
1874
1874
  print(e) {
1875
1875
  var n, a, i, c;
1876
1876
  const r = ((a = (n = e == null ? void 0 : e.printParams) == null ? void 0 : n.functionId) != null ? a : "") + lt().replace(/-/g, "");
1877
- if (this.printList.push({ printId: r, callBack: e == null ? void 0 : e.callBack }), this.printList = this.printList.filter((s, d, u) => d === u.findIndex((_) => _.printId === s.printId)), window.__MICRO_APP_ENVIRONMENT__) {
1878
- const { printParams: s, callBack: d } = e;
1879
- return (c = (i = window.rawWindow.__mini_app_hook__) == null ? void 0 : i.print) == null || c.call(i, T(b({}, s), { printId: r }), d), { id: r };
1877
+ if (this.printList.push({ printId: r, callBack: e == null ? void 0 : e.callBack }), this.printList = this.printList.filter((s, l, u) => l === u.findIndex((_) => _.printId === s.printId)), window.__MICRO_APP_ENVIRONMENT__) {
1878
+ const { printParams: s, callBack: l } = e;
1879
+ return (c = (i = window.rawWindow.__mini_app_hook__) == null ? void 0 : i.print) == null || c.call(i, T(b({}, s), { printId: r }), l), { id: r };
1880
1880
  }
1881
1881
  try {
1882
- return or.print(T(b({}, e == null ? void 0 : e.printParams), { printId: r })), ((s, d) => {
1882
+ return or.print(T(b({}, e == null ? void 0 : e.printParams), { printId: r })), ((s, l) => {
1883
1883
  try {
1884
1884
  const { printParams: u } = s;
1885
- wt(d, u);
1885
+ wt(l, u);
1886
1886
  } catch (u) {
1887
1887
  throw console.error("createPrint error", u), u;
1888
1888
  }
@@ -1905,12 +1905,22 @@ const Lr = typeof window != "undefined";
1905
1905
  let Se = null;
1906
1906
  var Nr;
1907
1907
  Lr && window.__MICRO_APP_ENVIRONMENT__ && (Se = (Nr = window.rawWindow.__mini_app_status_hook__) != null ? Nr : {});
1908
- const ar = w.registerPlugin("DownloadFilePlugin", { web: new class extends y {
1908
+ const ut = (t) => {
1909
+ var e, r;
1910
+ if (!t)
1911
+ return "";
1912
+ try {
1913
+ const n = decodeURIComponent(t).match(/\/([^/?#&=]+)(?=$|[?&#])/g), a = (r = (e = n == null ? void 0 : n.pop()) == null ? void 0 : e.slice(1)) != null ? r : "", i = a.lastIndexOf(".");
1914
+ return i <= 0 ? a : a.slice(0, i);
1915
+ } catch (n) {
1916
+ return "";
1917
+ }
1918
+ }, ar = d.registerPlugin("DownloadFilePlugin", { web: new class extends y {
1909
1919
  downloadFile(t) {
1910
1920
  return o(this, null, function* () {
1911
1921
  return ((e, r, n = "") => ({ success: e, message: r, fileName: n }))(!1, "DownloadFilePlugin should be handled by shell", ((e) => {
1912
- var r;
1913
- return ((r = e == null ? void 0 : e.fileName) == null ? void 0 : r.trim()) || `path_${Date.now()}`;
1922
+ var n;
1923
+ return ((n = e == null ? void 0 : e.fileName) == null ? void 0 : n.trim()) || `${ut(e == null ? void 0 : e.url)}_${Date.now()}`;
1914
1924
  })(t));
1915
1925
  });
1916
1926
  }
@@ -1926,15 +1936,26 @@ const ar = w.registerPlugin("DownloadFilePlugin", { web: new class extends y {
1926
1936
  throw console.error("downloadFile getStatus error", t), t;
1927
1937
  }
1928
1938
  }
1929
- }() }), ut = typeof window != "undefined", _t = (t) => {
1930
- var e;
1931
- return ((e = t == null ? void 0 : t.fileName) == null ? void 0 : e.trim()) || `path_${Date.now()}`;
1932
- }, ir = (t, e) => ({ success: !1, message: e, fileName: _t(t) });
1933
- class ht {
1939
+ }() }), _t = typeof window != "undefined", ht = (t) => {
1940
+ var r;
1941
+ const e = (r = t == null ? void 0 : t.fileName) == null ? void 0 : r.trim();
1942
+ return e || `${((n) => {
1943
+ var a, i;
1944
+ if (!n)
1945
+ return "";
1946
+ try {
1947
+ const c = decodeURIComponent(n).match(/\/([^/?#&=]+)(?=$|[?&#])/g), s = (i = (a = c == null ? void 0 : c.pop()) == null ? void 0 : a.slice(1)) != null ? i : "", l = s.lastIndexOf(".");
1948
+ return l <= 0 ? s : s.slice(0, l);
1949
+ } catch (c) {
1950
+ return "";
1951
+ }
1952
+ })(t == null ? void 0 : t.url)}_${Date.now()}`;
1953
+ }, ir = (t, e) => ({ success: !1, message: e, fileName: ht(t) });
1954
+ class pt {
1934
1955
  downloadFile(e) {
1935
1956
  return o(this, null, function* () {
1936
1957
  try {
1937
- if (ut && window.__MICRO_APP_ENVIRONMENT__) {
1958
+ if (_t && window.__MICRO_APP_ENVIRONMENT__) {
1938
1959
  const r = window.rawWindow.__mini_app_hook__.downloadFile;
1939
1960
  return r ? yield r(e) : ir(e, "DownloadFilePlugin is not available");
1940
1961
  }
@@ -1954,7 +1975,7 @@ class ht {
1954
1975
  });
1955
1976
  }
1956
1977
  }
1957
- class pt {
1978
+ class mt {
1958
1979
  constructor() {
1959
1980
  P(this, "initialContextPlugins", new $r());
1960
1981
  P(this, "communicatePlugins", new zr());
@@ -1972,25 +1993,25 @@ class pt {
1972
1993
  P(this, "cameraForTakePhotoPlugin", new it());
1973
1994
  P(this, "httpPlugin", new st());
1974
1995
  P(this, "printPlugins", new dt());
1975
- P(this, "downloadFilePlugin", new ht());
1996
+ P(this, "downloadFilePlugin", new pt());
1976
1997
  }
1977
1998
  }
1978
- const Pt = new pt();
1979
- let l = null, Ne = null;
1999
+ const yt = new mt();
2000
+ let w = null, Ne = null;
1980
2001
  var Mr, fr;
1981
- window.__MICRO_APP_ENVIRONMENT__ && (l = (Mr = window.rawWindow.__mini_app_hook__) != null ? Mr : {}, Ne = (fr = window.rawWindow.__mini_app_status_hook__) != null ? fr : {});
1982
- const mt = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: class extends y {
2002
+ window.__MICRO_APP_ENVIRONMENT__ && (w = (Mr = window.rawWindow.__mini_app_hook__) != null ? Mr : {}, Ne = (fr = window.rawWindow.__mini_app_status_hook__) != null ? fr : {});
2003
+ const gt = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: class extends y {
1983
2004
  homeIsClick(t) {
1984
2005
  return o(this, null, function* () {
1985
2006
  var e;
1986
- window.__MICRO_APP_ENVIRONMENT__ && (console.log("window.microApp.forceDispatch homeIsClick", t), (e = l.disabledMenu) == null || e.call(l, t));
2007
+ window.__MICRO_APP_ENVIRONMENT__ && (console.log("window.microApp.forceDispatch homeIsClick", t), (e = w.disabledMenu) == null || e.call(w, t));
1987
2008
  });
1988
2009
  }
1989
2010
  openMiniApp(t) {
1990
2011
  return o(this, null, function* () {
1991
2012
  var e;
1992
2013
  try {
1993
- return window.__MICRO_APP_ENVIRONMENT__ && ((e = l.openMiniApp) == null || e.call(l, t)), new Promise((r) => {
2014
+ return window.__MICRO_APP_ENVIRONMENT__ && ((e = w.openMiniApp) == null || e.call(w, t)), new Promise((r) => {
1994
2015
  r(t);
1995
2016
  });
1996
2017
  } catch (r) {
@@ -2002,7 +2023,7 @@ const mt = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
2002
2023
  return o(this, null, function* () {
2003
2024
  var e;
2004
2025
  try {
2005
- return window.__MICRO_APP_ENVIRONMENT__ && (console.log("window.microApp.forceDispatch showTitle", t), (e = l.showTitle) == null || e.call(l, t)), new Promise((r) => {
2026
+ return window.__MICRO_APP_ENVIRONMENT__ && (console.log("window.microApp.forceDispatch showTitle", t), (e = w.showTitle) == null || e.call(w, t)), new Promise((r) => {
2006
2027
  r(t);
2007
2028
  });
2008
2029
  } catch (r) {
@@ -2014,7 +2035,7 @@ const mt = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
2014
2035
  return o(this, null, function* () {
2015
2036
  var e;
2016
2037
  try {
2017
- return window.__MICRO_APP_ENVIRONMENT__ && ((e = l.showFABMenu) == null || e.call(l, t)), new Promise((r) => {
2038
+ return window.__MICRO_APP_ENVIRONMENT__ && ((e = w.showFABMenu) == null || e.call(w, t)), new Promise((r) => {
2018
2039
  r(t);
2019
2040
  });
2020
2041
  } catch (r) {
@@ -2026,7 +2047,7 @@ const mt = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
2026
2047
  return o(this, null, function* () {
2027
2048
  var e;
2028
2049
  try {
2029
- return window.__MICRO_APP_ENVIRONMENT__ && ((e = l.disableFAB) == null || e.call(l, t)), new Promise((r) => {
2050
+ return window.__MICRO_APP_ENVIRONMENT__ && ((e = w.disableFAB) == null || e.call(w, t)), new Promise((r) => {
2030
2051
  r(t);
2031
2052
  });
2032
2053
  } catch (r) {
@@ -2038,7 +2059,7 @@ const mt = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
2038
2059
  return o(this, null, function* () {
2039
2060
  var e;
2040
2061
  try {
2041
- return window.__MICRO_APP_ENVIRONMENT__ && ((e = l.disableBack) == null || e.call(l, t)), new Promise((r) => {
2062
+ return window.__MICRO_APP_ENVIRONMENT__ && ((e = w.disableBack) == null || e.call(w, t)), new Promise((r) => {
2042
2063
  r(t);
2043
2064
  });
2044
2065
  } catch (r) {
@@ -2050,7 +2071,7 @@ const mt = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
2050
2071
  return o(this, null, function* () {
2051
2072
  var e;
2052
2073
  try {
2053
- return window.__MICRO_APP_ENVIRONMENT__ && ((e = l.showSubMask) == null || e.call(l, t)), new Promise((r) => {
2074
+ return window.__MICRO_APP_ENVIRONMENT__ && ((e = w.showSubMask) == null || e.call(w, t)), new Promise((r) => {
2054
2075
  r(t);
2055
2076
  });
2056
2077
  } catch (r) {
@@ -2062,7 +2083,7 @@ const mt = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
2062
2083
  return o(this, null, function* () {
2063
2084
  var e;
2064
2085
  try {
2065
- return window.__MICRO_APP_ENVIRONMENT__ && ((e = l.setMiniAppVersion) == null || e.call(l, t)), new Promise((r) => {
2086
+ return window.__MICRO_APP_ENVIRONMENT__ && ((e = w.setMiniAppVersion) == null || e.call(w, t)), new Promise((r) => {
2066
2087
  r(t);
2067
2088
  });
2068
2089
  } catch (r) {
@@ -2073,13 +2094,13 @@ const mt = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
2073
2094
  showDialog() {
2074
2095
  return o(this, null, function* () {
2075
2096
  var t;
2076
- window.__MICRO_APP_ENVIRONMENT__ && ((t = l.showDialog) == null || t.call(l));
2097
+ window.__MICRO_APP_ENVIRONMENT__ && ((t = w.showDialog) == null || t.call(w));
2077
2098
  });
2078
2099
  }
2079
2100
  cancelDialog() {
2080
2101
  return o(this, null, function* () {
2081
2102
  var t;
2082
- window.__MICRO_APP_ENVIRONMENT__ && ((t = l.cancelDialog) == null || t.call(l));
2103
+ window.__MICRO_APP_ENVIRONMENT__ && ((t = w.cancelDialog) == null || t.call(w));
2083
2104
  });
2084
2105
  }
2085
2106
  getMiniAppKong(t) {
@@ -2087,7 +2108,7 @@ const mt = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
2087
2108
  var e, r;
2088
2109
  try {
2089
2110
  if (window.__MICRO_APP_ENVIRONMENT__) {
2090
- const n = (r = (e = l.getMiniAppKong) == null ? void 0 : e.call(l, t)) != null ? r : {};
2111
+ const n = (r = (e = w.getMiniAppKong) == null ? void 0 : e.call(w, t)) != null ? r : {};
2091
2112
  return new Promise((a) => {
2092
2113
  a(n);
2093
2114
  });
@@ -2103,7 +2124,7 @@ const mt = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
2103
2124
  closeMiniApp() {
2104
2125
  return o(this, null, function* () {
2105
2126
  var t;
2106
- window.__MICRO_APP_ENVIRONMENT__ && ((t = l.closeMiniApp) == null || t.call(l));
2127
+ window.__MICRO_APP_ENVIRONMENT__ && ((t = w.closeMiniApp) == null || t.call(w));
2107
2128
  });
2108
2129
  }
2109
2130
  getStatus() {
@@ -2122,7 +2143,7 @@ const mt = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
2122
2143
  try {
2123
2144
  return window.__MICRO_APP_ENVIRONMENT__ ? new Promise((e) => o(this, null, function* () {
2124
2145
  var r;
2125
- e((yield (r = l == null ? void 0 : l.dispatchToShell) == null ? void 0 : r.call(l, t)) || {});
2146
+ e((yield (r = w == null ? void 0 : w.dispatchToShell) == null ? void 0 : r.call(w, t)) || {});
2126
2147
  })) : new Promise((e) => {
2127
2148
  e(t);
2128
2149
  });
@@ -2134,7 +2155,7 @@ const mt = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
2134
2155
  try {
2135
2156
  return window.__MICRO_APP_ENVIRONMENT__ ? new Promise((e) => o(this, null, function* () {
2136
2157
  var r;
2137
- e((yield (r = l == null ? void 0 : l.getMiniAppInfo) == null ? void 0 : r.call(l, t)) || {});
2158
+ e((yield (r = w == null ? void 0 : w.getMiniAppInfo) == null ? void 0 : r.call(w, t)) || {});
2138
2159
  })) : new Promise((e) => {
2139
2160
  e({});
2140
2161
  });
@@ -2144,6 +2165,6 @@ const mt = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
2144
2165
  }
2145
2166
  } }, Symbol.toStringTag, { value: "Module" }));
2146
2167
  export {
2147
- pt as NativeApi,
2148
- Pt as default
2168
+ mt as NativeApi,
2169
+ yt as default
2149
2170
  };
package/lib/main.umd.cjs CHANGED
@@ -1,3 +1,3 @@
1
- /* eslint-disable no-restricted-globals, no-unused-expressions */
1
+ /* eslint-disable */
2
2
  /* global globalThis, AndroidInitialContext */
3
- var ht=Object.defineProperty,pt=Object.defineProperties;var mt=Object.getOwnPropertyDescriptors;var Tr=Object.getOwnPropertySymbols;var gt=Object.prototype.hasOwnProperty,Pt=Object.prototype.propertyIsEnumerable;var je=(N,g,S)=>g in N?ht(N,g,{enumerable:!0,configurable:!0,writable:!0,value:S}):N[g]=S,q=(N,g)=>{for(var S in g||(g={}))gt.call(g,S)&&je(N,S,g[S]);if(Tr)for(var S of Tr(g))Pt.call(g,S)&&je(N,S,g[S]);return N},K=(N,g)=>pt(N,mt(g));var M=(N,g,S)=>(je(N,typeof g!="symbol"?g+"":g,S),S);var o=(N,g,S)=>new Promise((B,z)=>{var Oe=v=>{try{l(S.next(v))}catch(P){z(P)}},Ae=v=>{try{l(S.throw(v))}catch(P){z(P)}},l=v=>v.done?B(v.value):Promise.resolve(v.value).then(Oe,Ae);l((S=S.apply(N,g)).next())});(function(N,g){typeof exports=="object"&&typeof module!="undefined"?g(exports):typeof define=="function"&&define.amd?define(["exports"],g):g((N=typeof globalThis!="undefined"?globalThis:N||self).main={})})(this,function(N){var _r,hr,pr,mr,gr,Pr,yr,Sr,Nr,Mr,fr,Ir,Cr,vr,Or,Ar,Lr;"use strict";/*! Capacitor: https://capacitorjs.com/ - MIT License */const g=t=>t.CapacitorPlatforms=(e=>{const r=new Map;r.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:r};return n.addPlatform=(a,i)=>{n.platforms.set(a,i)},n.setPlatform=a=>{n.platforms.has(a)&&(n.currentPlatform=n.platforms.get(a))},n})(t),S=g(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var B;S.addPlatform,S.setPlatform,function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"}(B||(B={}));class z extends Error{constructor(e,r,n){super(e),this.message=e,this.code=r,this.data=n}}const Oe=t=>{var e,r,n,a,i;const c=t.CapacitorCustomPlatform||null,s=t.Capacitor||{},d=s.Plugins=s.Plugins||{},u=t.CapacitorPlatforms,_=((e=u==null?void 0:u.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||(()=>c!==null?c.name:(h=>{var m,I;return h!=null&&h.androidBridge?"android":!((I=(m=h==null?void 0:h.webkit)===null||m===void 0?void 0:m.messageHandlers)===null||I===void 0)&&I.bridge?"ios":"web"})(t)),p=((r=u==null?void 0:u.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||(()=>_()!=="web"),O=((n=u==null?void 0:u.currentPlatform)===null||n===void 0?void 0:n.isPluginAvailable)||(h=>{const m=A.get(h);return!!(m!=null&&m.platforms.has(_()))||!!b(h)}),b=((a=u==null?void 0:u.currentPlatform)===null||a===void 0?void 0:a.getPluginHeader)||(h=>{var m;return(m=s.PluginHeaders)===null||m===void 0?void 0:m.find(I=>I.name===h)}),A=new Map,L=((i=u==null?void 0:u.currentPlatform)===null||i===void 0?void 0:i.registerPlugin)||((h,m={})=>{const I=A.get(h);if(I)return console.warn(`Capacitor plugin "${h}" already registered. Cannot register plugins twice.`),I.proxy;const E=_(),X=b(h);let $;const Ue=T=>{let V;const J=(...ve)=>{const Z=(()=>o(this,null,function*(){return!$&&E in m?$=$=typeof m[E]=="function"?yield m[E]():m[E]:c!==null&&!$&&"web"in m&&($=$=typeof m.web=="function"?yield m.web():m.web),$}))().then(Y=>{const kr=((R,ee)=>{var De,xe;if(!X){if(R)return(xe=R[ee])===null||xe===void 0?void 0:xe.bind(R);throw new z(`"${h}" plugin is not implemented on ${E}`,B.Unimplemented)}{const br=X==null?void 0:X.methods.find(re=>ee===re.name);if(br)return br.rtype==="promise"?re=>s.nativePromise(h,ee.toString(),re):(re,_t)=>s.nativeCallback(h,ee.toString(),re,_t);if(R)return(De=R[ee])===null||De===void 0?void 0:De.bind(R)}})(Y,T);if(kr){const R=kr(...ve);return V=R==null?void 0:R.remove,R}throw new z(`"${h}.${T}()" is not implemented on ${E}`,B.Unimplemented)});return T==="addListener"&&(Z.remove=()=>o(this,null,function*(){return V()})),Z};return J.toString=()=>`${T.toString()}() { [capacitor code] }`,Object.defineProperty(J,"name",{value:T,writable:!1,configurable:!1}),J},Er=Ue("addListener"),Rr=Ue("removeListener"),ut=(T,V)=>{const J=Er({eventName:T},V),ve=()=>o(this,null,function*(){const Y=yield J;Rr({eventName:T,callbackId:Y},V)}),Z=new Promise(Y=>J.then(()=>Y({remove:ve})));return Z.remove=()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield ve()}),Z},We=new Proxy({},{get(T,V){switch(V){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return X?ut:Er;case"removeListener":return Rr;default:return Ue(V)}}});return d[h]=We,A.set(h,{name:h,proxy:We,platforms:new Set([...Object.keys(m),...X?[E]:[]])}),We});return s.convertFileSrc||(s.convertFileSrc=h=>h),s.getPlatform=_,s.handleError=h=>t.console.error(h),s.isNativePlatform=p,s.isPluginAvailable=O,s.pluginMethodNoop=(h,m,I)=>Promise.reject(`${I} does not have an implementation of "${m}".`),s.registerPlugin=L,s.Exception=z,s.DEBUG=!!s.DEBUG,s.isLoggingEnabled=!!s.isLoggingEnabled,s.platform=s.getPlatform(),s.isNative=s.isNativePlatform(),s},Ae=t=>t.Capacitor=Oe(t),l=Ae(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}),v=l.registerPlugin;l.Plugins;class P{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,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const a=()=>o(this,null,function*(){return this.removeListener(e,r)}),i=Promise.resolve({remove:a});return Object.defineProperty(i,"remove",{value:()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield a()})}),i}removeAllListeners(){return o(this,null,function*(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}})}notifyListeners(e,r){const n=this.listeners[e];n&&n.forEach(a=>a(r))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:n=>{this.notifyListeners(r,n)}}}unimplemented(e="not implemented"){return new l.Exception(e,B.Unimplemented)}unavailable(e="not available"){return new l.Exception(e,B.Unavailable)}removeListener(e,r){return o(this,null,function*(){const n=this.listeners[e];if(!n)return;const a=n.indexOf(r);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 $e=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),qe=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Br extends P{getCookies(){return o(this,null,function*(){const e=document.cookie,r={};return e.split(";").forEach(n=>{if(n.length<=0)return;let[a,i]=n.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");a=qe(a).trim(),i=qe(i).trim(),r[a]=i}),r})}setCookie(e){return o(this,null,function*(){try{const r=$e(e.key),n=$e(e.value),a=`; expires=${(e.expires||"").replace("expires=","")}`,i=(e.path||"/").replace("path=",""),c=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${r}=${n||""}${a}; path=${i}; ${c};`}catch(r){return Promise.reject(r)}})}deleteCookie(e){return o(this,null,function*(){try{document.cookie=`${e.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}})}clearCookies(){return o(this,null,function*(){try{const e=document.cookie.split(";")||[];for(const r of e)document.cookie=r.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 Br});const Vr=(t,e={})=>{const r=Object.assign({method:t.method||"GET",headers:t.headers},e),n=((a={})=>{const i=Object.keys(a);return Object.keys(a).map(c=>c.toLocaleLowerCase()).reduce((c,s,d)=>(c[s]=a[i[d]],c),{})})(t.headers)["content-type"]||"";if(typeof t.data=="string")r.body=t.data;else if(n.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[i,c]of Object.entries(t.data||{}))a.set(i,c);r.body=a.toString()}else if(n.includes("multipart/form-data")){const a=new FormData;if(t.data instanceof FormData)t.data.forEach((c,s)=>{a.append(s,c)});else for(const c of Object.keys(t.data))a.append(c,t.data[c]);r.body=a;const i=new Headers(r.headers);i.delete("content-type"),r.headers=i}else(n.includes("application/json")||typeof t.data=="object")&&(r.body=JSON.stringify(t.data));return r};class Hr extends P{request(e){return o(this,null,function*(){const r=Vr(e,e.webFetchExtra),n=((p,O=!0)=>p?Object.entries(p).reduce((b,A)=>{const[L,h]=A;let m,I;return Array.isArray(h)?(I="",h.forEach(E=>{m=O?encodeURIComponent(E):E,I+=`${L}=${m}&`}),I.slice(0,-1)):(m=O?encodeURIComponent(h):h,I=`${L}=${m}`),`${b}&${I}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),a=n?`${e.url}?${n}`:e.url,i=yield fetch(a,r),c=i.headers.get("content-type")||"";let s,d,{responseType:u="text"}=i.ok?e:{};switch(c.includes("application/json")&&(u="json"),u){case"arraybuffer":case"blob":d=yield i.blob(),s=yield(p=>o(this,null,function*(){return new Promise((O,b)=>{const A=new FileReader;A.onload=()=>{const L=A.result;O(L.indexOf(",")>=0?L.split(",")[1]:L)},A.onerror=L=>b(L),A.readAsDataURL(p)})}))(d);break;case"json":s=yield i.json();break;default:s=yield i.text()}const _={};return i.headers.forEach((p,O)=>{_[O]=p}),{data:s,headers:_,status:i.status,url:i.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 Le(){return l.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}v("CapacitorHttp",{web:()=>new Hr}),v("Portals",{web:()=>Promise.resolve().then(function(){return Fr}).then(t=>new t.PortalsWeb)});const Fr=Object.freeze({__proto__:null,PortalsWeb:class extends P{publishNative(t){return o(this,null,function*(){})}}}),te=t=>{var e,r,n;try{if(typeof window=="undefined")return;if(Le&&((e=Le())!=null&&e.value)){const a=(n=(r=Le())==null?void 0:r.value)!=null?n:null;if(!a)return void console.error("native initialContext is undefine");if(!t)return void console.error("initialContext call back is undefine");t(a)}}catch(a){throw console.error("getInitialContextHandle error",a),a}};class Ur{isNative(){try{return(()=>{try{if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.isNative();{let e=!1;return te(r=>{e=!!(r!=null&&r.isNative)}),e}}catch(e){throw console.error("isNative error",e),e}})()}catch(e){throw console.error("isNative error",e),e}}redirectPage(e){try{if(window.__MICRO_APP_ENVIRONMENT__){const r=window.rawWindow.__mini_app_hook__.redirectPage(window.__MICRO_APP_NAME__);if(console.log("redirectParams",r),r)return e.callBack(r)}else(({callBack:r})=>{te(n=>{var a;try{if(!(n!=null&&n.params))return void console.info("initial context native params is undefine");const i=(a=n==null?void 0:n.params)!=null?a:null;if(!i)return;if(!r)return void console.error("initial context call back is undefine");r(i)}catch(i){throw console.error("redirectPageHandle error",i),i}})})(e)}catch(r){throw console.error("redirectPage error",r),r}}getNativeInfo(e){var r;try{return this.isNative()?window.__MICRO_APP_ENVIRONMENT__?(r=window.rawWindow.__mini_app_hook__.getNativeInfo(e))!=null?r:{}:(()=>{try{let n=null;return te(a=>{n=a!=null?a:null}),n}catch(n){throw console.error("getNativeInfoHandle error",n),n}})():(n=>{var a;return(a=n==null?void 0:n.mockData)!=null?a:null})(e)}catch(n){throw console.error("getNativeInfo error",n),n}}getStatus(){return new Promise(e=>{e({isNative:!0,redirectPage:!0,getNativeInfo:!0})})}}const C=()=>{try{let t={};return typeof window!="undefined"&&(t=window),t}catch(t){throw console.error("isWinHandle error",t),t}},k="CommunicatePlugin",y=l.registerPlugin(k,{web:()=>Promise.resolve().then(()=>dt).then(t=>new t.PluginsWeb)}),ne=C();ne.removeAddListenerFab=()=>null;const Wr=(t,e)=>{var r,n;try{ne.removeAddListenerFab&&ne.removeAddListenerFab();const a=[];if((r=y.showFABMenu)==null||r.call(y,{fabMenu:a,position:null}),!t||!((n=Object.keys(t))!=null&&n.length))return;Object.keys(t).forEach(i=>{var c,s,d,u,_,p,O,b;a.push({disable:(s=(c=t==null?void 0:t[i])==null?void 0:c.disable)!=null?s:!1,icon:(u=(d=t==null?void 0:t[i])==null?void 0:d.icon)!=null?u:"",id:(p=(_=t==null?void 0:t[i])==null?void 0:_.id)!=null?p:"",name:(b=(O=t==null?void 0:t[i])==null?void 0:O.title)!=null?b:""})}),queueMicrotask(()=>{var i;(i=y.showFABMenu)==null||i.call(y,{fabMenu:a,position:e!=null?e:null})}),setTimeout(()=>{(i=>o(this,null,function*(){i&&(ne.removeAddListenerFab=yield(c=>o(this,null,function*(){try{if(l.addListener){const s=yield l.addListener(k,"nativeSendFab",d=>c&&c(d));return s!=null&&s.remove?s.remove:()=>null}}catch(s){throw console.error("addListenerFabHandle error",s),s}}))(i))}))(i=>{let c;i!=null&&i.disable||i!=null&&i.id&&(Object.keys(t).forEach(s=>{var d,u,_;(d=t==null?void 0:t[s])!=null&&d.id&&i.id===t[s].id&&(c=(_=(u=t[s])==null?void 0:u.fn)!=null?_:()=>null)}),typeof c=="function"&&c())})})}catch(a){throw console.error("fabBtnHandle error",a),a}},H=C();H.addListenerBackRemoveHandle=()=>null;const Ke=(t=()=>null)=>o(this,null,function*(){try{H!=null&&H.addListenerBackRemoveHandle&&typeof H.addListenerBackRemoveHandle=="function"&&H.addListenerBackRemoveHandle(),H.addListenerBackRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(k,"nativeSendBack",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerBackHandle error",r),r}}))(t)}catch(e){throw console.error("initBackBtnFn error",e),e}}),oe=C();oe.addListenerHomeHandle=()=>null;const Dr=t=>{try{oe.addListenerHomeHandle&&oe.addListenerHomeHandle(),setTimeout(()=>{(e=>o(this,null,function*(){e&&(oe.addListenerHomeHandle=yield(r=>o(this,null,function*(){try{if(l.addListener){const n=yield l.addListener(k,"nativeSendHome",a=>r&&r(a));return n!=null&&n.remove?n.remove:()=>null}}catch(n){throw console.error("addListenerHomeHandle error",n),n}}))(e))}))(t)})}catch(e){throw console.error("homeFn error",e),e}},F=C();F.addListenerTouchRemoveHandle=()=>null;const ze=(t=()=>null)=>o(this,null,function*(){try{F!=null&&F.addListenerTouchRemoveHandle&&typeof F.addListenerTouchRemoveHandle=="function"&&F.addListenerTouchRemoveHandle(),F.addListenerTouchRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(k,"nativeTouchListener",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerTouchHandle error",r),r}}))(t)}catch(e){throw console.error("initTouchFn error",e),e}}),U=C();U.addListenerSendDeepLinkRemoveHandle=()=>null;const Je=(t=()=>null)=>o(this,null,function*(){try{U!=null&&U.addListenerSendDeepLinkRemoveHandle&&typeof U.addListenerSendDeepLinkRemoveHandle=="function"&&U.addListenerSendDeepLinkRemoveHandle(),U.addListenerSendDeepLinkRemoveHandle=yield(e=>o(this,null,function*(){try{if(window.__MICRO_APP_ENVIRONMENT__)return e&&window.rawWindow.__mini_app_hook__.getDeeplinkParams(e),{remove:()=>null};if(l.addListener){const r=yield l.addListener(k,"nativeSendDeeplinkCallbackListener",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerSendDeepLinkHandle error",r),r}}))(t)}catch(e){throw console.error("initTouchFn error",e),e}}),W=C();W.addListenerSwitchLanguageRemoveHandle=()=>null;const Ge=(t=()=>null)=>o(this,null,function*(){try{W!=null&&W.addListenerSwitchLanguageRemoveHandle&&typeof W.addListenerSwitchLanguageRemoveHandle=="function"&&W.addListenerSwitchLanguageRemoveHandle(),W.addListenerSwitchLanguageRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(k,"nativeSendSwitchLanguage",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.switchLanguage=e,{remove:()=>{window.rawWindow.__mini_app_hook__.switchLanguage=null}}}catch(r){throw console.error("addListenerSwitchLanguageHandle error",r),r}}))(t)}catch(e){throw console.error("initSwitchLanguageFn error",e),e}}),D=C();D.addListenerSetupMiniAppRemoveHandle=()=>null;const Qe=(t=()=>null)=>o(this,null,function*(){try{D!=null&&D.addListenerSetupMiniAppRemoveHandle&&typeof D.addListenerSetupMiniAppRemoveHandle=="function"&&D.addListenerSetupMiniAppRemoveHandle(),D.addListenerSetupMiniAppRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(k,"nativeSetupMiniApp",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerSetupMiniAppHandle error",r),r}}))(t)}catch(e){throw console.error("initSetupMiniAppFn error",e),e}}),x=C();x.addListenerSwitchStoreRemoveHandle=()=>null;const Xe=(t=()=>null)=>o(this,null,function*(){try{x!=null&&x.addListenerSwitchStoreRemoveHandle&&typeof x.addListenerSwitchStoreRemoveHandle=="function"&&x.addListenerSwitchStoreRemoveHandle(),x.addListenerSwitchStoreRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(k,"nativeSendSwitchStore",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.switchStore=e,{remove:()=>{window.rawWindow.__mini_app_hook__.switchStore=null}}}catch(r){throw console.error("addListenerSwitchStoreHandle error",r),r}}))(t)}catch(e){throw console.error("initSwitchStoreFn error",e),e}});class xr{constructor(){this.homeBtnSwitch({isClick:!0})}homeBtnSwitch(e){return o(this,null,function*(){var r;try{return yield(r=y.homeIsClick)==null?void 0:r.call(y,e)}catch(n){throw console.error("homeBtnSwitch error",n),n}})}setBackBtn(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Ke(i)}),a(()=>{Ke()})}catch(n){throw console.error("backBtnHandle error",n),n}})(e)}catch(r){throw console.error("setBackBtn error",r),r}}setHomeBtn(e){try{window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setHomeBtn=e:Dr(e)}catch(r){throw console.error("setHomeBtn error",r),r}}setFabBtn(e,r){try{window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setFabBtn(e,r):Wr(e,r)}catch(n){throw console.error("setFabBtn error",n),n}}touchListener(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{ze(i)}),a(()=>{ze()})}catch(n){throw console.error("touchListenerHandle error",n),n}})(e)}catch(r){throw console.error("listenerTouch error",r),r}}disableFAB(e){return o(this,null,function*(){try{return yield y.disableFAB(e)}catch(r){throw console.error("disableFAB error",r),r}})}disableBack(e){return o(this,null,function*(){try{return yield y.disableBack(e)}catch(r){throw console.error("disableBack error",r),r}})}openMiniApp(e){return o(this,null,function*(){try{return yield y.openMiniApp(e)}catch(r){throw console.error("openMiniApp error",r),r}})}showTitle(e){return o(this,null,function*(){try{return yield y.showTitle(e)}catch(r){throw console.error("showTitle error",r),r}})}showSubMask(e){return o(this,null,function*(){try{return yield y.showSubMask(e)}catch(r){throw console.error("showSubMask error",r),r}})}setMiniAppVersion(e){return o(this,null,function*(){try{return yield y.setMiniAppVersion(e)}catch(r){throw console.error("setMiniAppVersion error",r),r}})}showNativeLoading(){return o(this,null,function*(){try{return yield y.showDialog()}catch(e){throw console.error("showNativeLoading error",e),e}})}cancelNativeLoading(){return o(this,null,function*(){try{return yield y.cancelDialog()}catch(e){throw console.error("cancelNativeLoading error",e),e}})}getMiniAppKong(e){return o(this,null,function*(){try{return yield y.getMiniAppKong(e)}catch(r){throw console.error("getMiniAppKong error",r),r}})}getDeeplinkParams(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Je(i)}),a(()=>{Je()})}catch(n){throw console.error("sendDeepLinkListenerHandle error",n),n}})(e)}catch(r){throw console.error("getDeeplinkParams error",r),r}}switchLanguage(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Ge(i)}),a(()=>{Ge()})}catch(n){throw console.error("sendSwitchLanguageHandle error",n),n}})(e)}catch(r){throw console.error("switchLanguage error",r),r}}setupMiniApp(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Qe(i)}),a(()=>{Qe()})}catch(n){throw console.error("setupMiniAppHandle error",n),n}})(e)}catch(r){throw console.error("setupMiniApp error",r),r}}switchStore(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Xe(i)}),a(()=>{Xe()})}catch(n){throw console.error("sendSwitchStoreHandle error",n),n}})(e)}catch(r){throw console.error("switchStore error",r),r}}closeMiniApp(){return o(this,null,function*(){try{return yield y.closeMiniApp()}catch(e){throw console.error("closeMiniApp error",e),e}})}getStatus(){return o(this,null,function*(){try{return yield y.getStatus()}catch(e){throw console.error("communicatePlugins getStatus error",e),e}})}dispatchToShell(e){return o(this,null,function*(){try{return yield y.dispatchToShell(e)}catch(r){throw console.error("communicate dispatchToShell error",r),r}})}getMiniAppInfo(e){return o(this,null,function*(){try{return yield y.getMiniAppInfo(e)}catch(r){throw console.error("getMiniAppInfo error",r),r}})}}let ae=null;window.__MICRO_APP_ENVIRONMENT__&&(ae=(_r=window.rawWindow.__mini_app_status_hook__)!=null?_r:{});const Ee=l.registerPlugin("CameraScanPlugin",{web:new class extends P{pickCameraScan(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}setCameraScanState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ae==null?void 0:ae.cameraScan)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScan getStatus error",t),t}}}});window.removeAddListenerCameraScan=()=>null;class jr{pickCameraScan(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScan(e):yield Ee.pickCameraScan(e)}catch(r){throw console.error("pickCameraScan error",r),r}})}setCameraScanState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraScanState(e):yield Ee.setCameraScanState(e)}catch(r){throw console.error("setCameraScanState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Ee.getStatus()}catch(e){throw console.error("cameraScanPlugin getStatus error",e),e}})}}let ie=null;window.__MICRO_APP_ENVIRONMENT__&&(ie=(hr=window.rawWindow.__mini_app_status_hook__)!=null?hr:{});const Re=l.registerPlugin("CameraScanMultiplePlugin",{web:new class extends P{pickCameraScanMultiple(){return o(this,null,function*(){})}setCameraScanMultipleState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ie==null?void 0:ie.cameraScanMultiple)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScanMultiple getStatus error",t),t}}}});class $r{pickCameraScanMultiple(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanMultiple(e):yield Re.pickCameraScanMultiple(e)}catch(r){throw console.error("pickCameraScanMultiple error",r),r}})}setCameraScanMultipleState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraScanMultipleState(e):yield Re.setCameraScanMultipleState(e)}catch(r){throw console.error("setCameraScanMultipleState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Re.getStatus()}catch(e){throw console.error("cameraScanMultiplePlugin getStatus error",e),e}})}}let se=null;window.__MICRO_APP_ENVIRONMENT__&&(se=(pr=window.rawWindow.__mini_app_status_hook__)!=null?pr:{});const ke=l.registerPlugin("CameraScanMultipleNoCountPlugin",{web:new class extends P{pickCameraScanMultipleNoCount(){return o(this,null,function*(){})}setCameraScanMultipleNoCountState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=se==null?void 0:se.cameraScanMultipleNoCount)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScanMultipleNoCount getStatus error",t),t}}}});class qr{pickCameraScanMultipleNoCount(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanMultipleNoCount(e):yield ke.pickCameraScanMultipleNoCount(e)}catch(r){throw console.error("pickCameraScanMultipleNoCount error",r),r}})}setCameraScanMultipleNoCountState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraScanMultipleNoCountState(e):yield ke.setCameraScanMultipleNoCountState(e)}catch(r){throw console.error("setCameraScanMultipleNoCountState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield ke.getStatus()}catch(e){throw console.error("cameraScanMultipleNoCountPlugin getStatus error",e),e}})}}let ce=null;window.__MICRO_APP_ENVIRONMENT__&&(ce=(mr=window.rawWindow.__mini_app_status_hook__)!=null?mr:{});const be=l.registerPlugin("CameraScanSingleOrDualPlugin",{web:new class extends P{pickCameraScanSingleOrDual(){return o(this,null,function*(){})}setCameraScanSingleOrDualState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ce==null?void 0:ce.cameraScanSingleOrDual)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScanSingleOrDual getStatus error",t),t}}}});class Kr{pickCameraScanSingleOrDual(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanSingleOrDual(e):yield be.pickCameraScanSingleOrDual(e)}catch(r){throw console.error("pickCameraScanSingleOrDual error",r),r}})}setCameraScanSingleOrDualState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.setCameraScanSingleOrDualState(e):yield be.setCameraScanSingleOrDualState(e)}catch(r){throw console.error("setCameraScanSingleOrDualState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield be.getStatus()}catch(e){throw console.error("cameraScanSingleOrDualPlugin getStatus error",e),e}})}}const Ze="LaserScanPlugin";let le=null;window.__MICRO_APP_ENVIRONMENT__&&(le=(gr=window.rawWindow.__mini_app_status_hook__)!=null?gr:{});const we=l.registerPlugin(Ze,{web:new class extends P{pickLaserScan(){return o(this,null,function*(){})}unPickLaserScan(){return o(this,null,function*(){})}setLaserState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=le==null?void 0:le.laserScan)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("laserScan getStatus error",t),t}}}}),de=C();de.removeAddListenerLaserScan=()=>null;const Ye=(t=()=>null)=>{try{de.removeAddListenerLaserScan&&de.removeAddListenerLaserScan();const e=r=>o(this,null,function*(){r&&(de.removeAddListenerLaserScan=yield(n=>o(this,null,function*(){try{if(l.addListener){const a=yield l.addListener(Ze,"nativeSendLaser",i=>n&&n(i));return a!=null&&a.remove?a.remove:()=>null}}catch(a){throw console.error("addListenerLaserHandle error",a),a}}))(r))});setTimeout(()=>{e(t)})}catch(e){throw console.error("laserScanFn error",e),e}};class zr{constructor(){this.pickLaserScan()}pickLaserScan(){return o(this,null,function*(){try{return yield we.pickLaserScan({isContinue:!1})}catch(e){throw console.error("pickLaserScan error",e),e}})}unPickLaserScan(){return o(this,null,function*(){try{return yield we.unPickLaserScan()}catch(e){throw console.error("unPickLaserScan error",e),e}})}setLaserState(e){try{we.setLaserState(e)}catch(r){throw console.error("setLaserState error",r),r}}setLaserScan(e){(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Ye(i)}),a(()=>{Ye()})}catch(n){throw console.error("laserScanApiParams error",n),n}})(e)}getStatus(){return o(this,null,function*(){try{return yield we.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}const er="CountAssistPlugin";let ue=null;window.__MICRO_APP_ENVIRONMENT__&&(ue=(Pr=window.rawWindow.__mini_app_status_hook__)!=null?Pr:{});const _e=l.registerPlugin(er,{web:new class extends P{setCountAssistState(t){return o(this,null,function*(){try{return new Promise(e=>{e(t)})}catch(e){throw console.error("setCountAssistState error",e),e}})}toggleCountAssist(t){return o(this,null,function*(){try{return new Promise(e=>{e(t)})}catch(e){throw console.error("hideCountAssist error",e),e}})}getCountAssistToggleState(){return o(this,null,function*(){try{return new Promise(t=>{t(void 0)})}catch(t){throw console.error("getCountAssistToggleState error",t),t}})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ue==null?void 0:ue.countAssist)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("countAssist getStatus error",t),t}}}}),j=C();j.addListenerCountAssistRemoveHandle=()=>null;const rr=(t=()=>null)=>o(this,null,function*(){try{j!=null&&j.addListenerCountAssistRemoveHandle&&typeof j.addListenerCountAssistRemoveHandle=="function"&&j.addListenerCountAssistRemoveHandle(),j.addListenerCountAssistRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(er,"nativeSendCountAssist",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerCountAssistHandle error",r),r}}))(t)}catch(e){throw console.error("initCountAssistFn error",e),e}});class Jr{setCountAssistState(e){return o(this,null,function*(){return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.setCountAssistState(e):yield _e.setCountAssistState(e)})}getCountAssistState(e){return(r=>{try{let n=r!=null?r:!1;return te(a=>{n=!!(a!=null&&a.countAssistState)}),n}catch(n){throw console.error("getCountAssistStateHandle error",n),n}})(e)}setCountAssistBtn(e){(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{rr(i)}),a(()=>{rr()})}catch(n){throw console.error("setCountAssistBtnHandle error",n),n}})(e)}toggleCountAssist(e){return o(this,null,function*(){return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.toggleCountAssist(e):yield _e.toggleCountAssist(e)})}getCountAssistToggleState(){return o(this,null,function*(){return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.getCountAssistToggleState():yield _e.getCountAssistToggleState()})}getStatus(){return o(this,null,function*(){try{return yield _e.getStatus()}catch(e){throw console.error("countAssistPlugin getStatus error",e),e}})}}let he=null;window.__MICRO_APP_ENVIRONMENT__&&(he=(yr=window.rawWindow.__mini_app_status_hook__)!=null?yr:{});const Te=l.registerPlugin("ClickStreamPlugin",{web:new class extends P{init(){return o(this,null,function*(){return new Promise(t=>{t(null)})})}trace(t){return o(this,null,function*(){var e,r;try{return window.__MICRO_APP_ENVIRONMENT__&&((r=(e=window.rawWindow.__mini_app_hook__).clickStream)==null||r.call(e,t.data)),new Promise(n=>{n(t)})}catch(n){throw console.error("clickStreamTraceParams error",n),n}})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=he==null?void 0:he.clickStream)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("clickStream getStatus error",t),t}}}});class Gr{constructor(){this.init()}init(){return o(this,null,function*(){try{return yield Te.init()}catch(e){throw console.error("clickStreamPlugin, init error",e),e}})}trace(e){return o(this,null,function*(){try{return yield Te.trace(e)}catch(r){throw console.error("clickStreamPlugin, trace error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Te.getStatus()}catch(e){throw console.error("clickStreamPlugin getStatus error",e),e}})}}const tr="MiniAppLifecyclePlugin";let pe=null;window.__MICRO_APP_ENVIRONMENT__&&(pe=(Sr=window.rawWindow.__mini_app_status_hook__)!=null?Sr:{});var G=(t=>(t.MINI_APP_BEFORE_UNMOUNT_PERMISSION="mini_app_before_unmount_permission",t.MINI_APP_BEFORE_UNMOUNT_COMPLETION="mini_app_before_unmount_completion",t))(G||{});const Be=l.registerPlugin(tr,{web:new class extends P{setNativeUsagePermission(){return o(this,null,function*(){})}authorizeWebCallback(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=pe==null?void 0:pe.lifecycle)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("lifecycle getStatus error",t),t}}}}),me=C();me.removeAddListenerLifecycleMiniAppBeforeUnmount=()=>null;const nr=(t=()=>null)=>{try{me.removeAddListenerLifecycleMiniAppBeforeUnmount&&me.removeAddListenerLifecycleMiniAppBeforeUnmount();const e=r=>o(this,null,function*(){r&&(me.removeAddListenerLifecycleMiniAppBeforeUnmount=yield(n=>o(this,null,function*(){try{if(l.addListener){const a=yield l.addListener(tr,"miniAppBeforeUnmount",i=>n&&n(i));return a!=null&&a.remove?a.remove:()=>null}}catch(a){throw console.error("miniAppBeforeUnmountHandle error",a),a}}))(r))});setTimeout(()=>o(this,null,function*(){yield e(t)}))}catch(e){throw console.error("laserScanFn error",e),e}};class Qr{constructor(){}setNativeUsagePermission(e){return o(this,null,function*(){try{return yield Be.setNativeUsagePermission(e)}catch(r){throw console.error("lifecyclePlugin.setNativeUsagePermission error",r),r}})}authorizeWebCallback(e){return o(this,null,function*(){try{return yield Be.authorizeWebCallback(e)}catch(r){throw console.error("lifecyclePlugin.authorizeWebCallback error",r),r}})}miniAppBeforeUnmount(e){this.setNativeUsagePermission({action:G.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!0}),((r,n)=>{try{const{mounted:a,beforeUnmount:i,callBack:c}=r;a(()=>{nr(s=>o(this,null,function*(){var d;if(c&&c instanceof Function)try{(d=c(s))==null||d.then(()=>o(this,null,function*(){yield n.setNativeUsagePermission({action:G.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!1}),yield n.authorizeWebCallback({action:G.MINI_APP_BEFORE_UNMOUNT_COMPLETION})}))}catch(u){console.error("miniAppBeforeUnmount error callBack is not a function or promise")}else console.error("miniAppBeforeUnmount error callBack is not a function or promise")}))}),i(()=>o(this,null,function*(){nr(),n.setNativeUsagePermission({action:G.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!1})}))}catch(a){throw console.error("miniAppBeforeUnmount error",a),a}})(e,this)}getStatus(){return o(this,null,function*(){try{return yield Be.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let ge=null;window.__MICRO_APP_ENVIRONMENT__&&(ge=(Nr=window.rawWindow.__mini_app_status_hook__)!=null?Nr:{});const Ve=l.registerPlugin("DeviceInteractionPlugin",{web:new class extends P{callVibrate(){return o(this,null,function*(){})}callErrorBeep(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ge==null?void 0:ge.deviceInteraction)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("deviceInteraction getStatus error",t),t}}}});class Xr{callVibrate(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.callVibrate():yield Ve.callVibrate()}catch(e){throw console.error("callVibrate error",e),e}})}callErrorBeep(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.callErrorBeep():yield Ve.callErrorBeep()}catch(e){throw console.error("callErrorBeep error",e),e}})}getStatus(){return o(this,null,function*(){try{return yield Ve.getStatus()}catch(e){throw console.error("deviceInteractionPlugin getStatus error",e),e}})}}const or="PollingPlugin";let Pe=null;window.__MICRO_APP_ENVIRONMENT__&&(Pe=(Mr=window.rawWindow.__mini_app_status_hook__)!=null?Mr:{});const He=l.registerPlugin(or,{web:new class extends P{create(){return o(this,null,function*(){})}destroy(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=Pe==null?void 0:Pe.polling)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("polling getStatus error",t),t}}}}),ye=C();ye.removeAddListenerPolling=()=>null;const Zr=(t,e)=>{try{ye.removeAddListenerPolling&&ye.removeAddListenerPolling();const r=e.pollingId;(n=>o(this,null,function*(){return n&&(ye.removeAddListenerPolling=yield(a=>o(this,null,function*(){try{if(l.addListener){const i=yield l.addListener(or,"nativeSendPolling",c=>a&&a(c));return i!=null&&i.remove?i.remove:()=>null}}catch(i){throw console.error("addListenerPollingHandle error",i),i}}))(n))}))(n=>{(n==null?void 0:n.pollingId)===r&&(n!=null&&n.pollingId)&&t.pollingList.forEach(a=>{a!=null&&a.pollingId&&(n==null?void 0:n.pollingId)===(a==null?void 0:a.pollingId)&&typeof(a==null?void 0:a.callBack)=="function"&&a.callBack(n)})})}catch(r){throw console.error("pollingFn error",r),r}};class Yr{constructor(){M(this,"pollingList");this.pollingList=[]}create(e){var r,n,a;if(window.__MICRO_APP_ENVIRONMENT__){const{mounted:i,pollingParams:c,callBack:s}=e;return i(()=>{var d,u;(u=(d=window.rawWindow.__mini_app_hook__)==null?void 0:d.addPolling)==null||u.call(d,c,s)}),()=>{this.destroy({pollingId:c.pollingId})}}try{(r=e==null?void 0:e.pollingParams)!=null&&r.pollingId&&this.pollingList.push({pollingId:(n=e==null?void 0:e.pollingParams)==null?void 0:n.pollingId,callBack:e==null?void 0:e.callBack}),this.pollingList=this.pollingList.filter((c,s,d)=>s===d.findIndex(u=>u.pollingId===c.pollingId));const i=((a=e==null?void 0:e.pollingParams)==null?void 0:a.delay)/1e3;return He.create(K(q({},e==null?void 0:e.pollingParams),{delay:i})),((c,s)=>{try{const{mounted:d,pollingParams:u}=c;d(()=>Zr(s,u))}catch(d){throw console.error("createPolling error",d),d}})(e,this),()=>{var c,s;return(c=e==null?void 0:e.pollingParams)!=null&&c.pollingId?this.destroy({pollingId:(s=e==null?void 0:e.pollingParams)==null?void 0:s.pollingId}):null}}catch(i){throw console.error("pollingPlugin create error",i),i}}destroy(e){var r,n,a;if(window.__MICRO_APP_ENVIRONMENT__){const{pollingId:i}=e;(n=(r=window.rawWindow.__mini_app_hook__)==null?void 0:r.deletePolling)==null||n.call(r,i)}else try{const i=this.pollingList.map(c=>c.pollingId).indexOf(e.pollingId);return(a=this.pollingList)!=null&&a.length&&(Number(i)||Number(i)>=0)&&this.pollingList.splice(Number(i),1),He.destroy(e)}catch(i){throw console.error("pollingPlugin destroy error",i),i}}getStatus(){return o(this,null,function*(){try{return yield He.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let Se=null;window.__MICRO_APP_ENVIRONMENT__&&(Se=(fr=window.rawWindow.__mini_app_status_hook__)!=null?fr:{});const ar=l.registerPlugin("PaymentPlugin",{web:new class extends P{process(t){return o(this,null,function*(){try{return new Promise(e=>{e(t)})}catch(e){throw console.error("process error",e),e}})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=Se==null?void 0:Se.payment)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("payment getStatus error",t),t}}}});class et{process(e){return o(this,null,function*(){try{return yield ar.process(e)}catch(r){throw console.error("paymentPlugins.process error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield ar.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let Ne=null;window.__MICRO_APP_ENVIRONMENT__&&(Ne=(Ir=window.rawWindow.__mini_app_status_hook__)!=null?Ir:{});const Fe=l.registerPlugin("CameraForTakePhotoPlugin",{web:new class extends P{pickCameraForTakePhoto(){return o(this,null,function*(){})}setCameraForTakePhotoState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=Ne==null?void 0:Ne.cameraForTakePhoto)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraForTakePhoto getStatus error",t),t}}}});class rt{pickCameraForTakePhoto(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraForTakePhoto():yield Fe.pickCameraForTakePhoto()}catch(e){throw console.error("pickCameraForTakePhoto error",e),e}})}setCameraForTakePhotoState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraForTakePhotoState(e):yield Fe.setCameraForTakePhotoState(e)}catch(r){throw console.error("setCameraForTakePhotoState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Fe.getStatus()}catch(e){throw console.error("cameraForTakePhotoPlugin getStatus error",e),e}})}}let Me=null;window.__MICRO_APP_ENVIRONMENT__&&(Me=(Cr=window.rawWindow.__mini_app_status_hook__)!=null?Cr:{});const ir=l.registerPlugin("HttpPlugin",{web:new class extends P{request(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=Me==null?void 0:Me.http)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("http getStatus error",t),t}}}});class tt{request(e){return o(this,null,function*(){try{if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.requestHttp(e);{let r={};return e.url&&(r.url=e.url),e.method&&(r.method=e.method),e.headers&&(r.headers=e.headers),e.params&&(r.urlParams=e.params),e.data&&(typeof e.data=="string"?r.bodyData=e.data:r.bodyParams=e.data),e.upload&&(r.upload=e.upload),yield ir.request(r)}}catch(r){throw console.error("HttpPlugin, trace error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield ir.getStatus()}catch(e){throw console.error("HttpPlugin getStatus error",e),e}})}}const f=[];for(let t=0;t<256;++t)f.push((t+256).toString(16).slice(1));const nt=new Uint8Array(16);function ot(t,e,r){return e||t||!crypto.randomUUID?function(n,a,i){var s,d,u;n=n||{};const c=(u=(d=n.random)!=null?d:(s=n.rng)==null?void 0:s.call(n))!=null?u:crypto.getRandomValues(nt);if(c.length<16)throw new Error("Random bytes length must be >= 16");if(c[6]=15&c[6]|64,c[8]=63&c[8]|128,a){if((i=i||0)<0||i+16>a.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let _=0;_<16;++_)a[i+_]=c[_];return a}return function(_,p=0){return(f[_[p+0]]+f[_[p+1]]+f[_[p+2]]+f[_[p+3]]+"-"+f[_[p+4]]+f[_[p+5]]+"-"+f[_[p+6]]+f[_[p+7]]+"-"+f[_[p+8]]+f[_[p+9]]+"-"+f[_[p+10]]+f[_[p+11]]+f[_[p+12]]+f[_[p+13]]+f[_[p+14]]+f[_[p+15]]).toLowerCase()}(c)}(t,e,r):crypto.randomUUID()}const sr="PrintPlugin";let fe=null;window.__MICRO_APP_ENVIRONMENT__&&(fe=(vr=window.rawWindow.__mini_app_status_hook__)!=null?vr:{});const cr=l.registerPlugin(sr,{web:new class extends P{print(){}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=fe==null?void 0:fe.print)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("print getStatus error",t),t}}}}),Q=C();Q.removeAddListenerPrintList={};const at=(t,e)=>{try{const r=e.printId;Q.removeAddListenerPrintList=K(q({},Q.removeAddListenerPrintList),{printId:()=>{}}),(n=>o(this,null,function*(){return n&&(Q.removeAddListenerPrintList[r]=yield(a=>o(this,null,function*(){try{if(l.addListener){const i=yield l.addListener(sr,"nativeSendPrint",c=>a&&a(c));return i!=null&&i.remove?i.remove:()=>null}}catch(i){throw console.error("addListenerPrintHandle error",i),i}}))(n))}))(n=>{(n==null?void 0:n.printId)===r&&(n!=null&&n.printId)&&t.printList.forEach(a=>{var i,c,s;a!=null&&a.printId&&(n==null?void 0:n.printId)===(a==null?void 0:a.printId)&&(typeof(a==null?void 0:a.callBack)=="function"&&a.callBack(n),(s=a.state==5||a.state==6)!=null||(c=(i=Q.removeAddListenerPrintList)==null?void 0:i[a==null?void 0:a.printId])==null||c.call(i))})})}catch(r){throw console.error("printFn error",r),r}};class it{constructor(){M(this,"printList");this.printList=[]}print(e){var n,a,i,c;const r=((a=(n=e==null?void 0:e.printParams)==null?void 0:n.functionId)!=null?a:"")+ot().replace(/-/g,"");if(this.printList.push({printId:r,callBack:e==null?void 0:e.callBack}),this.printList=this.printList.filter((s,d,u)=>d===u.findIndex(_=>_.printId===s.printId)),window.__MICRO_APP_ENVIRONMENT__){const{printParams:s,callBack:d}=e;return(c=(i=window.rawWindow.__mini_app_hook__)==null?void 0:i.print)==null||c.call(i,K(q({},s),{printId:r}),d),{id:r}}try{return cr.print(K(q({},e==null?void 0:e.printParams),{printId:r})),((s,d)=>{try{const{printParams:u}=s;at(d,u)}catch(u){throw console.error("createPrint error",u),u}})(K(q({},e),{printParams:K(q({},e.printParams),{printId:r})}),this),{id:r}}catch(s){throw console.error("printPlugin create error",s),s}}getStatus(){return o(this,null,function*(){try{return yield cr.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}const lr=typeof window!="undefined";let Ie=null;lr&&window.__MICRO_APP_ENVIRONMENT__&&(Ie=(Or=window.rawWindow.__mini_app_status_hook__)!=null?Or:{});const wr=l.registerPlugin("DownloadFilePlugin",{web:new class extends P{downloadFile(t){return o(this,null,function*(){return((e,r,n="")=>({success:e,message:r,fileName:n}))(!1,"DownloadFilePlugin should be handled by shell",(e=>{var r;return((r=e==null?void 0:e.fileName)==null?void 0:r.trim())||`path_${Date.now()}`})(t))})}getStatus(){try{return lr&&window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=Ie==null?void 0:Ie.downloadFile)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("downloadFile getStatus error",t),t}}}}),st=typeof window!="undefined",ct=t=>{var e;return((e=t==null?void 0:t.fileName)==null?void 0:e.trim())||`path_${Date.now()}`},dr=(t,e)=>({success:!1,message:e,fileName:ct(t)});class lt{downloadFile(e){return o(this,null,function*(){try{if(st&&window.__MICRO_APP_ENVIRONMENT__){const r=window.rawWindow.__mini_app_hook__.downloadFile;return r?yield r(e):dr(e,"DownloadFilePlugin is not available")}return yield wr.downloadFile(e)}catch(r){return console.error("downloadFile error",r),dr(e,r instanceof Error?r.message:"download failed")}})}getStatus(){return o(this,null,function*(){try{return yield wr.getStatus()}catch(e){throw console.error("downloadFile getStatus error",e),e}})}}class ur{constructor(){M(this,"initialContextPlugins",new Ur);M(this,"communicatePlugins",new xr);M(this,"cameraScanPlugins",new jr);M(this,"cameraScanMultiplePlugins",new $r);M(this,"cameraScanMultipleNoCountPlugins",new qr);M(this,"cameraScanSingleOrDualPlugins",new Kr);M(this,"laserScanPlugins",new zr);M(this,"countAssistPlugins",new Jr);M(this,"clickStreamPlugins",new Gr);M(this,"lifecyclePlugins",new Qr);M(this,"deviceInteractionPlugins",new Xr);M(this,"pollingPlugins",new Yr);M(this,"paymentPlugins",new et);M(this,"cameraForTakePhotoPlugin",new rt);M(this,"httpPlugin",new tt);M(this,"printPlugins",new it);M(this,"downloadFilePlugin",new lt)}}const wt=new ur;let w=null,Ce=null;window.__MICRO_APP_ENVIRONMENT__&&(w=(Ar=window.rawWindow.__mini_app_hook__)!=null?Ar:{},Ce=(Lr=window.rawWindow.__mini_app_status_hook__)!=null?Lr:{});const dt=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends P{homeIsClick(t){return o(this,null,function*(){var e;window.__MICRO_APP_ENVIRONMENT__&&(console.log("window.microApp.forceDispatch homeIsClick",t),(e=w.disabledMenu)==null||e.call(w,t))})}openMiniApp(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.openMiniApp)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("openMiniApp error",r),r}})}showTitle(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&(console.log("window.microApp.forceDispatch showTitle",t),(e=w.showTitle)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("showTitle error",r),r}})}showFABMenu(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.showFABMenu)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("showFABMenu error",r),r}})}disableFAB(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.disableFAB)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("disableFAB error",r),r}})}disableBack(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.disableBack)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("disableBack error",r),r}})}showSubMask(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.showSubMask)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("showSubMask error",r),r}})}setMiniAppVersion(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.setMiniAppVersion)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("setMiniAppVersion error",r),r}})}showDialog(){return o(this,null,function*(){var t;window.__MICRO_APP_ENVIRONMENT__&&((t=w.showDialog)==null||t.call(w))})}cancelDialog(){return o(this,null,function*(){var t;window.__MICRO_APP_ENVIRONMENT__&&((t=w.cancelDialog)==null||t.call(w))})}getMiniAppKong(t){return o(this,null,function*(){var e,r;try{if(window.__MICRO_APP_ENVIRONMENT__){const n=(r=(e=w.getMiniAppKong)==null?void 0:e.call(w,t))!=null?r:{};return new Promise(a=>{a(n)})}return new Promise(n=>{n(t)})}catch(n){throw console.error("getMiniAppKong error",n),n}})}closeMiniApp(){return o(this,null,function*(){var t;window.__MICRO_APP_ENVIRONMENT__&&((t=w.closeMiniApp)==null||t.call(w))})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=Ce==null?void 0:Ce.communicate)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("communicate getStatus error",t),t}}dispatchToShell(t){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(e=>o(this,null,function*(){var r;e((yield(r=w==null?void 0:w.dispatchToShell)==null?void 0:r.call(w,t))||{})})):new Promise(e=>{e(t)})}catch(e){throw console.error("communicate dispatchToShell error",e),e}}getMiniAppInfo(t){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(e=>o(this,null,function*(){var r;e((yield(r=w==null?void 0:w.getMiniAppInfo)==null?void 0:r.call(w,t))||{})})):new Promise(e=>{e({})})}catch(e){throw console.error("communicate getMiniAppInfo error",e),e}}}},Symbol.toStringTag,{value:"Module"}));N.NativeApi=ur,N.default=wt,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
3
+ var pt=Object.defineProperty,mt=Object.defineProperties;var gt=Object.getOwnPropertyDescriptors;var Tr=Object.getOwnPropertySymbols;var Pt=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable;var je=(N,g,S)=>g in N?pt(N,g,{enumerable:!0,configurable:!0,writable:!0,value:S}):N[g]=S,q=(N,g)=>{for(var S in g||(g={}))Pt.call(g,S)&&je(N,S,g[S]);if(Tr)for(var S of Tr(g))yt.call(g,S)&&je(N,S,g[S]);return N},K=(N,g)=>mt(N,gt(g));var f=(N,g,S)=>(je(N,typeof g!="symbol"?g+"":g,S),S);var o=(N,g,S)=>new Promise((B,z)=>{var Oe=v=>{try{l(S.next(v))}catch(P){z(P)}},Ae=v=>{try{l(S.throw(v))}catch(P){z(P)}},l=v=>v.done?B(v.value):Promise.resolve(v.value).then(Oe,Ae);l((S=S.apply(N,g)).next())});(function(N,g){typeof exports=="object"&&typeof module!="undefined"?g(exports):typeof define=="function"&&define.amd?define(["exports"],g):g((N=typeof globalThis!="undefined"?globalThis:N||self).main={})})(this,function(N){var _r,hr,pr,mr,gr,Pr,yr,Sr,Nr,fr,Mr,Ir,Cr,vr,Or,Ar,Lr;"use strict";/*! Capacitor: https://capacitorjs.com/ - MIT License */const g=t=>t.CapacitorPlatforms=(e=>{const r=new Map;r.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:r};return n.addPlatform=(a,i)=>{n.platforms.set(a,i)},n.setPlatform=a=>{n.platforms.has(a)&&(n.currentPlatform=n.platforms.get(a))},n})(t),S=g(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var B;S.addPlatform,S.setPlatform,function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"}(B||(B={}));class z extends Error{constructor(e,r,n){super(e),this.message=e,this.code=r,this.data=n}}const Oe=t=>{var e,r,n,a,i;const c=t.CapacitorCustomPlatform||null,s=t.Capacitor||{},w=s.Plugins=s.Plugins||{},u=t.CapacitorPlatforms,_=((e=u==null?void 0:u.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||(()=>c!==null?c.name:(h=>{var m,I;return h!=null&&h.androidBridge?"android":!((I=(m=h==null?void 0:h.webkit)===null||m===void 0?void 0:m.messageHandlers)===null||I===void 0)&&I.bridge?"ios":"web"})(t)),p=((r=u==null?void 0:u.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||(()=>_()!=="web"),O=((n=u==null?void 0:u.currentPlatform)===null||n===void 0?void 0:n.isPluginAvailable)||(h=>{const m=A.get(h);return!!(m!=null&&m.platforms.has(_()))||!!b(h)}),b=((a=u==null?void 0:u.currentPlatform)===null||a===void 0?void 0:a.getPluginHeader)||(h=>{var m;return(m=s.PluginHeaders)===null||m===void 0?void 0:m.find(I=>I.name===h)}),A=new Map,L=((i=u==null?void 0:u.currentPlatform)===null||i===void 0?void 0:i.registerPlugin)||((h,m={})=>{const I=A.get(h);if(I)return console.warn(`Capacitor plugin "${h}" already registered. Cannot register plugins twice.`),I.proxy;const E=_(),X=b(h);let $;const Ue=T=>{let V;const J=(...ve)=>{const Z=(()=>o(this,null,function*(){return!$&&E in m?$=$=typeof m[E]=="function"?yield m[E]():m[E]:c!==null&&!$&&"web"in m&&($=$=typeof m.web=="function"?yield m.web():m.web),$}))().then(Y=>{const kr=((R,ee)=>{var xe,De;if(!X){if(R)return(De=R[ee])===null||De===void 0?void 0:De.bind(R);throw new z(`"${h}" plugin is not implemented on ${E}`,B.Unimplemented)}{const br=X==null?void 0:X.methods.find(re=>ee===re.name);if(br)return br.rtype==="promise"?re=>s.nativePromise(h,ee.toString(),re):(re,ht)=>s.nativeCallback(h,ee.toString(),re,ht);if(R)return(xe=R[ee])===null||xe===void 0?void 0:xe.bind(R)}})(Y,T);if(kr){const R=kr(...ve);return V=R==null?void 0:R.remove,R}throw new z(`"${h}.${T}()" is not implemented on ${E}`,B.Unimplemented)});return T==="addListener"&&(Z.remove=()=>o(this,null,function*(){return V()})),Z};return J.toString=()=>`${T.toString()}() { [capacitor code] }`,Object.defineProperty(J,"name",{value:T,writable:!1,configurable:!1}),J},Er=Ue("addListener"),Rr=Ue("removeListener"),_t=(T,V)=>{const J=Er({eventName:T},V),ve=()=>o(this,null,function*(){const Y=yield J;Rr({eventName:T,callbackId:Y},V)}),Z=new Promise(Y=>J.then(()=>Y({remove:ve})));return Z.remove=()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield ve()}),Z},We=new Proxy({},{get(T,V){switch(V){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return X?_t:Er;case"removeListener":return Rr;default:return Ue(V)}}});return w[h]=We,A.set(h,{name:h,proxy:We,platforms:new Set([...Object.keys(m),...X?[E]:[]])}),We});return s.convertFileSrc||(s.convertFileSrc=h=>h),s.getPlatform=_,s.handleError=h=>t.console.error(h),s.isNativePlatform=p,s.isPluginAvailable=O,s.pluginMethodNoop=(h,m,I)=>Promise.reject(`${I} does not have an implementation of "${m}".`),s.registerPlugin=L,s.Exception=z,s.DEBUG=!!s.DEBUG,s.isLoggingEnabled=!!s.isLoggingEnabled,s.platform=s.getPlatform(),s.isNative=s.isNativePlatform(),s},Ae=t=>t.Capacitor=Oe(t),l=Ae(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}),v=l.registerPlugin;l.Plugins;class P{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,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const a=()=>o(this,null,function*(){return this.removeListener(e,r)}),i=Promise.resolve({remove:a});return Object.defineProperty(i,"remove",{value:()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield a()})}),i}removeAllListeners(){return o(this,null,function*(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}})}notifyListeners(e,r){const n=this.listeners[e];n&&n.forEach(a=>a(r))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:n=>{this.notifyListeners(r,n)}}}unimplemented(e="not implemented"){return new l.Exception(e,B.Unimplemented)}unavailable(e="not available"){return new l.Exception(e,B.Unavailable)}removeListener(e,r){return o(this,null,function*(){const n=this.listeners[e];if(!n)return;const a=n.indexOf(r);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 $e=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),qe=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Br extends P{getCookies(){return o(this,null,function*(){const e=document.cookie,r={};return e.split(";").forEach(n=>{if(n.length<=0)return;let[a,i]=n.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");a=qe(a).trim(),i=qe(i).trim(),r[a]=i}),r})}setCookie(e){return o(this,null,function*(){try{const r=$e(e.key),n=$e(e.value),a=`; expires=${(e.expires||"").replace("expires=","")}`,i=(e.path||"/").replace("path=",""),c=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${r}=${n||""}${a}; path=${i}; ${c};`}catch(r){return Promise.reject(r)}})}deleteCookie(e){return o(this,null,function*(){try{document.cookie=`${e.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}})}clearCookies(){return o(this,null,function*(){try{const e=document.cookie.split(";")||[];for(const r of e)document.cookie=r.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 Br});const Vr=(t,e={})=>{const r=Object.assign({method:t.method||"GET",headers:t.headers},e),n=((a={})=>{const i=Object.keys(a);return Object.keys(a).map(c=>c.toLocaleLowerCase()).reduce((c,s,w)=>(c[s]=a[i[w]],c),{})})(t.headers)["content-type"]||"";if(typeof t.data=="string")r.body=t.data;else if(n.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[i,c]of Object.entries(t.data||{}))a.set(i,c);r.body=a.toString()}else if(n.includes("multipart/form-data")){const a=new FormData;if(t.data instanceof FormData)t.data.forEach((c,s)=>{a.append(s,c)});else for(const c of Object.keys(t.data))a.append(c,t.data[c]);r.body=a;const i=new Headers(r.headers);i.delete("content-type"),r.headers=i}else(n.includes("application/json")||typeof t.data=="object")&&(r.body=JSON.stringify(t.data));return r};class Hr extends P{request(e){return o(this,null,function*(){const r=Vr(e,e.webFetchExtra),n=((p,O=!0)=>p?Object.entries(p).reduce((b,A)=>{const[L,h]=A;let m,I;return Array.isArray(h)?(I="",h.forEach(E=>{m=O?encodeURIComponent(E):E,I+=`${L}=${m}&`}),I.slice(0,-1)):(m=O?encodeURIComponent(h):h,I=`${L}=${m}`),`${b}&${I}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),a=n?`${e.url}?${n}`:e.url,i=yield fetch(a,r),c=i.headers.get("content-type")||"";let s,w,{responseType:u="text"}=i.ok?e:{};switch(c.includes("application/json")&&(u="json"),u){case"arraybuffer":case"blob":w=yield i.blob(),s=yield(p=>o(this,null,function*(){return new Promise((O,b)=>{const A=new FileReader;A.onload=()=>{const L=A.result;O(L.indexOf(",")>=0?L.split(",")[1]:L)},A.onerror=L=>b(L),A.readAsDataURL(p)})}))(w);break;case"json":s=yield i.json();break;default:s=yield i.text()}const _={};return i.headers.forEach((p,O)=>{_[O]=p}),{data:s,headers:_,status:i.status,url:i.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 Le(){return l.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}v("CapacitorHttp",{web:()=>new Hr}),v("Portals",{web:()=>Promise.resolve().then(function(){return Fr}).then(t=>new t.PortalsWeb)});const Fr=Object.freeze({__proto__:null,PortalsWeb:class extends P{publishNative(t){return o(this,null,function*(){})}}}),te=t=>{var e,r,n;try{if(typeof window=="undefined")return;if(Le&&((e=Le())!=null&&e.value)){const a=(n=(r=Le())==null?void 0:r.value)!=null?n:null;if(!a)return void console.error("native initialContext is undefine");if(!t)return void console.error("initialContext call back is undefine");t(a)}}catch(a){throw console.error("getInitialContextHandle error",a),a}};class Ur{isNative(){try{return(()=>{try{if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.isNative();{let e=!1;return te(r=>{e=!!(r!=null&&r.isNative)}),e}}catch(e){throw console.error("isNative error",e),e}})()}catch(e){throw console.error("isNative error",e),e}}redirectPage(e){try{if(window.__MICRO_APP_ENVIRONMENT__){const r=window.rawWindow.__mini_app_hook__.redirectPage(window.__MICRO_APP_NAME__);if(console.log("redirectParams",r),r)return e.callBack(r)}else(({callBack:r})=>{te(n=>{var a;try{if(!(n!=null&&n.params))return void console.info("initial context native params is undefine");const i=(a=n==null?void 0:n.params)!=null?a:null;if(!i)return;if(!r)return void console.error("initial context call back is undefine");r(i)}catch(i){throw console.error("redirectPageHandle error",i),i}})})(e)}catch(r){throw console.error("redirectPage error",r),r}}getNativeInfo(e){var r;try{return this.isNative()?window.__MICRO_APP_ENVIRONMENT__?(r=window.rawWindow.__mini_app_hook__.getNativeInfo(e))!=null?r:{}:(()=>{try{let n=null;return te(a=>{n=a!=null?a:null}),n}catch(n){throw console.error("getNativeInfoHandle error",n),n}})():(n=>{var a;return(a=n==null?void 0:n.mockData)!=null?a:null})(e)}catch(n){throw console.error("getNativeInfo error",n),n}}getStatus(){return new Promise(e=>{e({isNative:!0,redirectPage:!0,getNativeInfo:!0})})}}const C=()=>{try{let t={};return typeof window!="undefined"&&(t=window),t}catch(t){throw console.error("isWinHandle error",t),t}},k="CommunicatePlugin",y=l.registerPlugin(k,{web:()=>Promise.resolve().then(()=>ut).then(t=>new t.PluginsWeb)}),ne=C();ne.removeAddListenerFab=()=>null;const Wr=(t,e)=>{var r,n;try{ne.removeAddListenerFab&&ne.removeAddListenerFab();const a=[];if((r=y.showFABMenu)==null||r.call(y,{fabMenu:a,position:null}),!t||!((n=Object.keys(t))!=null&&n.length))return;Object.keys(t).forEach(i=>{var c,s,w,u,_,p,O,b;a.push({disable:(s=(c=t==null?void 0:t[i])==null?void 0:c.disable)!=null?s:!1,icon:(u=(w=t==null?void 0:t[i])==null?void 0:w.icon)!=null?u:"",id:(p=(_=t==null?void 0:t[i])==null?void 0:_.id)!=null?p:"",name:(b=(O=t==null?void 0:t[i])==null?void 0:O.title)!=null?b:""})}),queueMicrotask(()=>{var i;(i=y.showFABMenu)==null||i.call(y,{fabMenu:a,position:e!=null?e:null})}),setTimeout(()=>{(i=>o(this,null,function*(){i&&(ne.removeAddListenerFab=yield(c=>o(this,null,function*(){try{if(l.addListener){const s=yield l.addListener(k,"nativeSendFab",w=>c&&c(w));return s!=null&&s.remove?s.remove:()=>null}}catch(s){throw console.error("addListenerFabHandle error",s),s}}))(i))}))(i=>{let c;i!=null&&i.disable||i!=null&&i.id&&(Object.keys(t).forEach(s=>{var w,u,_;(w=t==null?void 0:t[s])!=null&&w.id&&i.id===t[s].id&&(c=(_=(u=t[s])==null?void 0:u.fn)!=null?_:()=>null)}),typeof c=="function"&&c())})})}catch(a){throw console.error("fabBtnHandle error",a),a}},H=C();H.addListenerBackRemoveHandle=()=>null;const Ke=(t=()=>null)=>o(this,null,function*(){try{H!=null&&H.addListenerBackRemoveHandle&&typeof H.addListenerBackRemoveHandle=="function"&&H.addListenerBackRemoveHandle(),H.addListenerBackRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(k,"nativeSendBack",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerBackHandle error",r),r}}))(t)}catch(e){throw console.error("initBackBtnFn error",e),e}}),oe=C();oe.addListenerHomeHandle=()=>null;const xr=t=>{try{oe.addListenerHomeHandle&&oe.addListenerHomeHandle(),setTimeout(()=>{(e=>o(this,null,function*(){e&&(oe.addListenerHomeHandle=yield(r=>o(this,null,function*(){try{if(l.addListener){const n=yield l.addListener(k,"nativeSendHome",a=>r&&r(a));return n!=null&&n.remove?n.remove:()=>null}}catch(n){throw console.error("addListenerHomeHandle error",n),n}}))(e))}))(t)})}catch(e){throw console.error("homeFn error",e),e}},F=C();F.addListenerTouchRemoveHandle=()=>null;const ze=(t=()=>null)=>o(this,null,function*(){try{F!=null&&F.addListenerTouchRemoveHandle&&typeof F.addListenerTouchRemoveHandle=="function"&&F.addListenerTouchRemoveHandle(),F.addListenerTouchRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(k,"nativeTouchListener",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerTouchHandle error",r),r}}))(t)}catch(e){throw console.error("initTouchFn error",e),e}}),U=C();U.addListenerSendDeepLinkRemoveHandle=()=>null;const Je=(t=()=>null)=>o(this,null,function*(){try{U!=null&&U.addListenerSendDeepLinkRemoveHandle&&typeof U.addListenerSendDeepLinkRemoveHandle=="function"&&U.addListenerSendDeepLinkRemoveHandle(),U.addListenerSendDeepLinkRemoveHandle=yield(e=>o(this,null,function*(){try{if(window.__MICRO_APP_ENVIRONMENT__)return e&&window.rawWindow.__mini_app_hook__.getDeeplinkParams(e),{remove:()=>null};if(l.addListener){const r=yield l.addListener(k,"nativeSendDeeplinkCallbackListener",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerSendDeepLinkHandle error",r),r}}))(t)}catch(e){throw console.error("initTouchFn error",e),e}}),W=C();W.addListenerSwitchLanguageRemoveHandle=()=>null;const Ge=(t=()=>null)=>o(this,null,function*(){try{W!=null&&W.addListenerSwitchLanguageRemoveHandle&&typeof W.addListenerSwitchLanguageRemoveHandle=="function"&&W.addListenerSwitchLanguageRemoveHandle(),W.addListenerSwitchLanguageRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(k,"nativeSendSwitchLanguage",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.switchLanguage=e,{remove:()=>{window.rawWindow.__mini_app_hook__.switchLanguage=null}}}catch(r){throw console.error("addListenerSwitchLanguageHandle error",r),r}}))(t)}catch(e){throw console.error("initSwitchLanguageFn error",e),e}}),x=C();x.addListenerSetupMiniAppRemoveHandle=()=>null;const Qe=(t=()=>null)=>o(this,null,function*(){try{x!=null&&x.addListenerSetupMiniAppRemoveHandle&&typeof x.addListenerSetupMiniAppRemoveHandle=="function"&&x.addListenerSetupMiniAppRemoveHandle(),x.addListenerSetupMiniAppRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(k,"nativeSetupMiniApp",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerSetupMiniAppHandle error",r),r}}))(t)}catch(e){throw console.error("initSetupMiniAppFn error",e),e}}),D=C();D.addListenerSwitchStoreRemoveHandle=()=>null;const Xe=(t=()=>null)=>o(this,null,function*(){try{D!=null&&D.addListenerSwitchStoreRemoveHandle&&typeof D.addListenerSwitchStoreRemoveHandle=="function"&&D.addListenerSwitchStoreRemoveHandle(),D.addListenerSwitchStoreRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(k,"nativeSendSwitchStore",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.switchStore=e,{remove:()=>{window.rawWindow.__mini_app_hook__.switchStore=null}}}catch(r){throw console.error("addListenerSwitchStoreHandle error",r),r}}))(t)}catch(e){throw console.error("initSwitchStoreFn error",e),e}});class Dr{constructor(){this.homeBtnSwitch({isClick:!0})}homeBtnSwitch(e){return o(this,null,function*(){var r;try{return yield(r=y.homeIsClick)==null?void 0:r.call(y,e)}catch(n){throw console.error("homeBtnSwitch error",n),n}})}setBackBtn(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Ke(i)}),a(()=>{Ke()})}catch(n){throw console.error("backBtnHandle error",n),n}})(e)}catch(r){throw console.error("setBackBtn error",r),r}}setHomeBtn(e){try{window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setHomeBtn=e:xr(e)}catch(r){throw console.error("setHomeBtn error",r),r}}setFabBtn(e,r){try{window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setFabBtn(e,r):Wr(e,r)}catch(n){throw console.error("setFabBtn error",n),n}}touchListener(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{ze(i)}),a(()=>{ze()})}catch(n){throw console.error("touchListenerHandle error",n),n}})(e)}catch(r){throw console.error("listenerTouch error",r),r}}disableFAB(e){return o(this,null,function*(){try{return yield y.disableFAB(e)}catch(r){throw console.error("disableFAB error",r),r}})}disableBack(e){return o(this,null,function*(){try{return yield y.disableBack(e)}catch(r){throw console.error("disableBack error",r),r}})}openMiniApp(e){return o(this,null,function*(){try{return yield y.openMiniApp(e)}catch(r){throw console.error("openMiniApp error",r),r}})}showTitle(e){return o(this,null,function*(){try{return yield y.showTitle(e)}catch(r){throw console.error("showTitle error",r),r}})}showSubMask(e){return o(this,null,function*(){try{return yield y.showSubMask(e)}catch(r){throw console.error("showSubMask error",r),r}})}setMiniAppVersion(e){return o(this,null,function*(){try{return yield y.setMiniAppVersion(e)}catch(r){throw console.error("setMiniAppVersion error",r),r}})}showNativeLoading(){return o(this,null,function*(){try{return yield y.showDialog()}catch(e){throw console.error("showNativeLoading error",e),e}})}cancelNativeLoading(){return o(this,null,function*(){try{return yield y.cancelDialog()}catch(e){throw console.error("cancelNativeLoading error",e),e}})}getMiniAppKong(e){return o(this,null,function*(){try{return yield y.getMiniAppKong(e)}catch(r){throw console.error("getMiniAppKong error",r),r}})}getDeeplinkParams(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Je(i)}),a(()=>{Je()})}catch(n){throw console.error("sendDeepLinkListenerHandle error",n),n}})(e)}catch(r){throw console.error("getDeeplinkParams error",r),r}}switchLanguage(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Ge(i)}),a(()=>{Ge()})}catch(n){throw console.error("sendSwitchLanguageHandle error",n),n}})(e)}catch(r){throw console.error("switchLanguage error",r),r}}setupMiniApp(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Qe(i)}),a(()=>{Qe()})}catch(n){throw console.error("setupMiniAppHandle error",n),n}})(e)}catch(r){throw console.error("setupMiniApp error",r),r}}switchStore(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Xe(i)}),a(()=>{Xe()})}catch(n){throw console.error("sendSwitchStoreHandle error",n),n}})(e)}catch(r){throw console.error("switchStore error",r),r}}closeMiniApp(){return o(this,null,function*(){try{return yield y.closeMiniApp()}catch(e){throw console.error("closeMiniApp error",e),e}})}getStatus(){return o(this,null,function*(){try{return yield y.getStatus()}catch(e){throw console.error("communicatePlugins getStatus error",e),e}})}dispatchToShell(e){return o(this,null,function*(){try{return yield y.dispatchToShell(e)}catch(r){throw console.error("communicate dispatchToShell error",r),r}})}getMiniAppInfo(e){return o(this,null,function*(){try{return yield y.getMiniAppInfo(e)}catch(r){throw console.error("getMiniAppInfo error",r),r}})}}let ae=null;window.__MICRO_APP_ENVIRONMENT__&&(ae=(_r=window.rawWindow.__mini_app_status_hook__)!=null?_r:{});const Ee=l.registerPlugin("CameraScanPlugin",{web:new class extends P{pickCameraScan(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}setCameraScanState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ae==null?void 0:ae.cameraScan)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScan getStatus error",t),t}}}});window.removeAddListenerCameraScan=()=>null;class jr{pickCameraScan(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScan(e):yield Ee.pickCameraScan(e)}catch(r){throw console.error("pickCameraScan error",r),r}})}setCameraScanState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraScanState(e):yield Ee.setCameraScanState(e)}catch(r){throw console.error("setCameraScanState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Ee.getStatus()}catch(e){throw console.error("cameraScanPlugin getStatus error",e),e}})}}let ie=null;window.__MICRO_APP_ENVIRONMENT__&&(ie=(hr=window.rawWindow.__mini_app_status_hook__)!=null?hr:{});const Re=l.registerPlugin("CameraScanMultiplePlugin",{web:new class extends P{pickCameraScanMultiple(){return o(this,null,function*(){})}setCameraScanMultipleState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ie==null?void 0:ie.cameraScanMultiple)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScanMultiple getStatus error",t),t}}}});class $r{pickCameraScanMultiple(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanMultiple(e):yield Re.pickCameraScanMultiple(e)}catch(r){throw console.error("pickCameraScanMultiple error",r),r}})}setCameraScanMultipleState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraScanMultipleState(e):yield Re.setCameraScanMultipleState(e)}catch(r){throw console.error("setCameraScanMultipleState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Re.getStatus()}catch(e){throw console.error("cameraScanMultiplePlugin getStatus error",e),e}})}}let se=null;window.__MICRO_APP_ENVIRONMENT__&&(se=(pr=window.rawWindow.__mini_app_status_hook__)!=null?pr:{});const ke=l.registerPlugin("CameraScanMultipleNoCountPlugin",{web:new class extends P{pickCameraScanMultipleNoCount(){return o(this,null,function*(){})}setCameraScanMultipleNoCountState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=se==null?void 0:se.cameraScanMultipleNoCount)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScanMultipleNoCount getStatus error",t),t}}}});class qr{pickCameraScanMultipleNoCount(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanMultipleNoCount(e):yield ke.pickCameraScanMultipleNoCount(e)}catch(r){throw console.error("pickCameraScanMultipleNoCount error",r),r}})}setCameraScanMultipleNoCountState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraScanMultipleNoCountState(e):yield ke.setCameraScanMultipleNoCountState(e)}catch(r){throw console.error("setCameraScanMultipleNoCountState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield ke.getStatus()}catch(e){throw console.error("cameraScanMultipleNoCountPlugin getStatus error",e),e}})}}let ce=null;window.__MICRO_APP_ENVIRONMENT__&&(ce=(mr=window.rawWindow.__mini_app_status_hook__)!=null?mr:{});const be=l.registerPlugin("CameraScanSingleOrDualPlugin",{web:new class extends P{pickCameraScanSingleOrDual(){return o(this,null,function*(){})}setCameraScanSingleOrDualState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ce==null?void 0:ce.cameraScanSingleOrDual)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScanSingleOrDual getStatus error",t),t}}}});class Kr{pickCameraScanSingleOrDual(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanSingleOrDual(e):yield be.pickCameraScanSingleOrDual(e)}catch(r){throw console.error("pickCameraScanSingleOrDual error",r),r}})}setCameraScanSingleOrDualState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.setCameraScanSingleOrDualState(e):yield be.setCameraScanSingleOrDualState(e)}catch(r){throw console.error("setCameraScanSingleOrDualState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield be.getStatus()}catch(e){throw console.error("cameraScanSingleOrDualPlugin getStatus error",e),e}})}}const Ze="LaserScanPlugin";let le=null;window.__MICRO_APP_ENVIRONMENT__&&(le=(gr=window.rawWindow.__mini_app_status_hook__)!=null?gr:{});const de=l.registerPlugin(Ze,{web:new class extends P{pickLaserScan(){return o(this,null,function*(){})}unPickLaserScan(){return o(this,null,function*(){})}setLaserState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=le==null?void 0:le.laserScan)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("laserScan getStatus error",t),t}}}}),we=C();we.removeAddListenerLaserScan=()=>null;const Ye=(t=()=>null)=>{try{we.removeAddListenerLaserScan&&we.removeAddListenerLaserScan();const e=r=>o(this,null,function*(){r&&(we.removeAddListenerLaserScan=yield(n=>o(this,null,function*(){try{if(l.addListener){const a=yield l.addListener(Ze,"nativeSendLaser",i=>n&&n(i));return a!=null&&a.remove?a.remove:()=>null}}catch(a){throw console.error("addListenerLaserHandle error",a),a}}))(r))});setTimeout(()=>{e(t)})}catch(e){throw console.error("laserScanFn error",e),e}};class zr{constructor(){this.pickLaserScan()}pickLaserScan(){return o(this,null,function*(){try{return yield de.pickLaserScan({isContinue:!1})}catch(e){throw console.error("pickLaserScan error",e),e}})}unPickLaserScan(){return o(this,null,function*(){try{return yield de.unPickLaserScan()}catch(e){throw console.error("unPickLaserScan error",e),e}})}setLaserState(e){try{de.setLaserState(e)}catch(r){throw console.error("setLaserState error",r),r}}setLaserScan(e){(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Ye(i)}),a(()=>{Ye()})}catch(n){throw console.error("laserScanApiParams error",n),n}})(e)}getStatus(){return o(this,null,function*(){try{return yield de.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}const er="CountAssistPlugin";let ue=null;window.__MICRO_APP_ENVIRONMENT__&&(ue=(Pr=window.rawWindow.__mini_app_status_hook__)!=null?Pr:{});const _e=l.registerPlugin(er,{web:new class extends P{setCountAssistState(t){return o(this,null,function*(){try{return new Promise(e=>{e(t)})}catch(e){throw console.error("setCountAssistState error",e),e}})}toggleCountAssist(t){return o(this,null,function*(){try{return new Promise(e=>{e(t)})}catch(e){throw console.error("hideCountAssist error",e),e}})}getCountAssistToggleState(){return o(this,null,function*(){try{return new Promise(t=>{t(void 0)})}catch(t){throw console.error("getCountAssistToggleState error",t),t}})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ue==null?void 0:ue.countAssist)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("countAssist getStatus error",t),t}}}}),j=C();j.addListenerCountAssistRemoveHandle=()=>null;const rr=(t=()=>null)=>o(this,null,function*(){try{j!=null&&j.addListenerCountAssistRemoveHandle&&typeof j.addListenerCountAssistRemoveHandle=="function"&&j.addListenerCountAssistRemoveHandle(),j.addListenerCountAssistRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(er,"nativeSendCountAssist",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerCountAssistHandle error",r),r}}))(t)}catch(e){throw console.error("initCountAssistFn error",e),e}});class Jr{setCountAssistState(e){return o(this,null,function*(){return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.setCountAssistState(e):yield _e.setCountAssistState(e)})}getCountAssistState(e){return(r=>{try{let n=r!=null?r:!1;return te(a=>{n=!!(a!=null&&a.countAssistState)}),n}catch(n){throw console.error("getCountAssistStateHandle error",n),n}})(e)}setCountAssistBtn(e){(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{rr(i)}),a(()=>{rr()})}catch(n){throw console.error("setCountAssistBtnHandle error",n),n}})(e)}toggleCountAssist(e){return o(this,null,function*(){return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.toggleCountAssist(e):yield _e.toggleCountAssist(e)})}getCountAssistToggleState(){return o(this,null,function*(){return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.getCountAssistToggleState():yield _e.getCountAssistToggleState()})}getStatus(){return o(this,null,function*(){try{return yield _e.getStatus()}catch(e){throw console.error("countAssistPlugin getStatus error",e),e}})}}let he=null;window.__MICRO_APP_ENVIRONMENT__&&(he=(yr=window.rawWindow.__mini_app_status_hook__)!=null?yr:{});const Te=l.registerPlugin("ClickStreamPlugin",{web:new class extends P{init(){return o(this,null,function*(){return new Promise(t=>{t(null)})})}trace(t){return o(this,null,function*(){var e,r;try{return window.__MICRO_APP_ENVIRONMENT__&&((r=(e=window.rawWindow.__mini_app_hook__).clickStream)==null||r.call(e,t.data)),new Promise(n=>{n(t)})}catch(n){throw console.error("clickStreamTraceParams error",n),n}})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=he==null?void 0:he.clickStream)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("clickStream getStatus error",t),t}}}});class Gr{constructor(){this.init()}init(){return o(this,null,function*(){try{return yield Te.init()}catch(e){throw console.error("clickStreamPlugin, init error",e),e}})}trace(e){return o(this,null,function*(){try{return yield Te.trace(e)}catch(r){throw console.error("clickStreamPlugin, trace error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Te.getStatus()}catch(e){throw console.error("clickStreamPlugin getStatus error",e),e}})}}const tr="MiniAppLifecyclePlugin";let pe=null;window.__MICRO_APP_ENVIRONMENT__&&(pe=(Sr=window.rawWindow.__mini_app_status_hook__)!=null?Sr:{});var G=(t=>(t.MINI_APP_BEFORE_UNMOUNT_PERMISSION="mini_app_before_unmount_permission",t.MINI_APP_BEFORE_UNMOUNT_COMPLETION="mini_app_before_unmount_completion",t))(G||{});const Be=l.registerPlugin(tr,{web:new class extends P{setNativeUsagePermission(){return o(this,null,function*(){})}authorizeWebCallback(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=pe==null?void 0:pe.lifecycle)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("lifecycle getStatus error",t),t}}}}),me=C();me.removeAddListenerLifecycleMiniAppBeforeUnmount=()=>null;const nr=(t=()=>null)=>{try{me.removeAddListenerLifecycleMiniAppBeforeUnmount&&me.removeAddListenerLifecycleMiniAppBeforeUnmount();const e=r=>o(this,null,function*(){r&&(me.removeAddListenerLifecycleMiniAppBeforeUnmount=yield(n=>o(this,null,function*(){try{if(l.addListener){const a=yield l.addListener(tr,"miniAppBeforeUnmount",i=>n&&n(i));return a!=null&&a.remove?a.remove:()=>null}}catch(a){throw console.error("miniAppBeforeUnmountHandle error",a),a}}))(r))});setTimeout(()=>o(this,null,function*(){yield e(t)}))}catch(e){throw console.error("laserScanFn error",e),e}};class Qr{constructor(){}setNativeUsagePermission(e){return o(this,null,function*(){try{return yield Be.setNativeUsagePermission(e)}catch(r){throw console.error("lifecyclePlugin.setNativeUsagePermission error",r),r}})}authorizeWebCallback(e){return o(this,null,function*(){try{return yield Be.authorizeWebCallback(e)}catch(r){throw console.error("lifecyclePlugin.authorizeWebCallback error",r),r}})}miniAppBeforeUnmount(e){this.setNativeUsagePermission({action:G.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!0}),((r,n)=>{try{const{mounted:a,beforeUnmount:i,callBack:c}=r;a(()=>{nr(s=>o(this,null,function*(){var w;if(c&&c instanceof Function)try{(w=c(s))==null||w.then(()=>o(this,null,function*(){yield n.setNativeUsagePermission({action:G.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!1}),yield n.authorizeWebCallback({action:G.MINI_APP_BEFORE_UNMOUNT_COMPLETION})}))}catch(u){console.error("miniAppBeforeUnmount error callBack is not a function or promise")}else console.error("miniAppBeforeUnmount error callBack is not a function or promise")}))}),i(()=>o(this,null,function*(){nr(),n.setNativeUsagePermission({action:G.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!1})}))}catch(a){throw console.error("miniAppBeforeUnmount error",a),a}})(e,this)}getStatus(){return o(this,null,function*(){try{return yield Be.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let ge=null;window.__MICRO_APP_ENVIRONMENT__&&(ge=(Nr=window.rawWindow.__mini_app_status_hook__)!=null?Nr:{});const Ve=l.registerPlugin("DeviceInteractionPlugin",{web:new class extends P{callVibrate(){return o(this,null,function*(){})}callErrorBeep(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ge==null?void 0:ge.deviceInteraction)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("deviceInteraction getStatus error",t),t}}}});class Xr{callVibrate(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.callVibrate():yield Ve.callVibrate()}catch(e){throw console.error("callVibrate error",e),e}})}callErrorBeep(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.callErrorBeep():yield Ve.callErrorBeep()}catch(e){throw console.error("callErrorBeep error",e),e}})}getStatus(){return o(this,null,function*(){try{return yield Ve.getStatus()}catch(e){throw console.error("deviceInteractionPlugin getStatus error",e),e}})}}const or="PollingPlugin";let Pe=null;window.__MICRO_APP_ENVIRONMENT__&&(Pe=(fr=window.rawWindow.__mini_app_status_hook__)!=null?fr:{});const He=l.registerPlugin(or,{web:new class extends P{create(){return o(this,null,function*(){})}destroy(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=Pe==null?void 0:Pe.polling)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("polling getStatus error",t),t}}}}),ye=C();ye.removeAddListenerPolling=()=>null;const Zr=(t,e)=>{try{ye.removeAddListenerPolling&&ye.removeAddListenerPolling();const r=e.pollingId;(n=>o(this,null,function*(){return n&&(ye.removeAddListenerPolling=yield(a=>o(this,null,function*(){try{if(l.addListener){const i=yield l.addListener(or,"nativeSendPolling",c=>a&&a(c));return i!=null&&i.remove?i.remove:()=>null}}catch(i){throw console.error("addListenerPollingHandle error",i),i}}))(n))}))(n=>{(n==null?void 0:n.pollingId)===r&&(n!=null&&n.pollingId)&&t.pollingList.forEach(a=>{a!=null&&a.pollingId&&(n==null?void 0:n.pollingId)===(a==null?void 0:a.pollingId)&&typeof(a==null?void 0:a.callBack)=="function"&&a.callBack(n)})})}catch(r){throw console.error("pollingFn error",r),r}};class Yr{constructor(){f(this,"pollingList");this.pollingList=[]}create(e){var r,n,a;if(window.__MICRO_APP_ENVIRONMENT__){const{mounted:i,pollingParams:c,callBack:s}=e;return i(()=>{var w,u;(u=(w=window.rawWindow.__mini_app_hook__)==null?void 0:w.addPolling)==null||u.call(w,c,s)}),()=>{this.destroy({pollingId:c.pollingId})}}try{(r=e==null?void 0:e.pollingParams)!=null&&r.pollingId&&this.pollingList.push({pollingId:(n=e==null?void 0:e.pollingParams)==null?void 0:n.pollingId,callBack:e==null?void 0:e.callBack}),this.pollingList=this.pollingList.filter((c,s,w)=>s===w.findIndex(u=>u.pollingId===c.pollingId));const i=((a=e==null?void 0:e.pollingParams)==null?void 0:a.delay)/1e3;return He.create(K(q({},e==null?void 0:e.pollingParams),{delay:i})),((c,s)=>{try{const{mounted:w,pollingParams:u}=c;w(()=>Zr(s,u))}catch(w){throw console.error("createPolling error",w),w}})(e,this),()=>{var c,s;return(c=e==null?void 0:e.pollingParams)!=null&&c.pollingId?this.destroy({pollingId:(s=e==null?void 0:e.pollingParams)==null?void 0:s.pollingId}):null}}catch(i){throw console.error("pollingPlugin create error",i),i}}destroy(e){var r,n,a;if(window.__MICRO_APP_ENVIRONMENT__){const{pollingId:i}=e;(n=(r=window.rawWindow.__mini_app_hook__)==null?void 0:r.deletePolling)==null||n.call(r,i)}else try{const i=this.pollingList.map(c=>c.pollingId).indexOf(e.pollingId);return(a=this.pollingList)!=null&&a.length&&(Number(i)||Number(i)>=0)&&this.pollingList.splice(Number(i),1),He.destroy(e)}catch(i){throw console.error("pollingPlugin destroy error",i),i}}getStatus(){return o(this,null,function*(){try{return yield He.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let Se=null;window.__MICRO_APP_ENVIRONMENT__&&(Se=(Mr=window.rawWindow.__mini_app_status_hook__)!=null?Mr:{});const ar=l.registerPlugin("PaymentPlugin",{web:new class extends P{process(t){return o(this,null,function*(){try{return new Promise(e=>{e(t)})}catch(e){throw console.error("process error",e),e}})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=Se==null?void 0:Se.payment)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("payment getStatus error",t),t}}}});class et{process(e){return o(this,null,function*(){try{return yield ar.process(e)}catch(r){throw console.error("paymentPlugins.process error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield ar.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let Ne=null;window.__MICRO_APP_ENVIRONMENT__&&(Ne=(Ir=window.rawWindow.__mini_app_status_hook__)!=null?Ir:{});const Fe=l.registerPlugin("CameraForTakePhotoPlugin",{web:new class extends P{pickCameraForTakePhoto(){return o(this,null,function*(){})}setCameraForTakePhotoState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=Ne==null?void 0:Ne.cameraForTakePhoto)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraForTakePhoto getStatus error",t),t}}}});class rt{pickCameraForTakePhoto(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraForTakePhoto():yield Fe.pickCameraForTakePhoto()}catch(e){throw console.error("pickCameraForTakePhoto error",e),e}})}setCameraForTakePhotoState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraForTakePhotoState(e):yield Fe.setCameraForTakePhotoState(e)}catch(r){throw console.error("setCameraForTakePhotoState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Fe.getStatus()}catch(e){throw console.error("cameraForTakePhotoPlugin getStatus error",e),e}})}}let fe=null;window.__MICRO_APP_ENVIRONMENT__&&(fe=(Cr=window.rawWindow.__mini_app_status_hook__)!=null?Cr:{});const ir=l.registerPlugin("HttpPlugin",{web:new class extends P{request(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=fe==null?void 0:fe.http)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("http getStatus error",t),t}}}});class tt{request(e){return o(this,null,function*(){try{if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.requestHttp(e);{let r={};return e.url&&(r.url=e.url),e.method&&(r.method=e.method),e.headers&&(r.headers=e.headers),e.params&&(r.urlParams=e.params),e.data&&(typeof e.data=="string"?r.bodyData=e.data:r.bodyParams=e.data),e.upload&&(r.upload=e.upload),yield ir.request(r)}}catch(r){throw console.error("HttpPlugin, trace error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield ir.getStatus()}catch(e){throw console.error("HttpPlugin getStatus error",e),e}})}}const M=[];for(let t=0;t<256;++t)M.push((t+256).toString(16).slice(1));const nt=new Uint8Array(16);function ot(t,e,r){return e||t||!crypto.randomUUID?function(n,a,i){var s,w,u;n=n||{};const c=(u=(w=n.random)!=null?w:(s=n.rng)==null?void 0:s.call(n))!=null?u:crypto.getRandomValues(nt);if(c.length<16)throw new Error("Random bytes length must be >= 16");if(c[6]=15&c[6]|64,c[8]=63&c[8]|128,a){if((i=i||0)<0||i+16>a.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let _=0;_<16;++_)a[i+_]=c[_];return a}return function(_,p=0){return(M[_[p+0]]+M[_[p+1]]+M[_[p+2]]+M[_[p+3]]+"-"+M[_[p+4]]+M[_[p+5]]+"-"+M[_[p+6]]+M[_[p+7]]+"-"+M[_[p+8]]+M[_[p+9]]+"-"+M[_[p+10]]+M[_[p+11]]+M[_[p+12]]+M[_[p+13]]+M[_[p+14]]+M[_[p+15]]).toLowerCase()}(c)}(t,e,r):crypto.randomUUID()}const sr="PrintPlugin";let Me=null;window.__MICRO_APP_ENVIRONMENT__&&(Me=(vr=window.rawWindow.__mini_app_status_hook__)!=null?vr:{});const cr=l.registerPlugin(sr,{web:new class extends P{print(){}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=Me==null?void 0:Me.print)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("print getStatus error",t),t}}}}),Q=C();Q.removeAddListenerPrintList={};const at=(t,e)=>{try{const r=e.printId;Q.removeAddListenerPrintList=K(q({},Q.removeAddListenerPrintList),{printId:()=>{}}),(n=>o(this,null,function*(){return n&&(Q.removeAddListenerPrintList[r]=yield(a=>o(this,null,function*(){try{if(l.addListener){const i=yield l.addListener(sr,"nativeSendPrint",c=>a&&a(c));return i!=null&&i.remove?i.remove:()=>null}}catch(i){throw console.error("addListenerPrintHandle error",i),i}}))(n))}))(n=>{(n==null?void 0:n.printId)===r&&(n!=null&&n.printId)&&t.printList.forEach(a=>{var i,c,s;a!=null&&a.printId&&(n==null?void 0:n.printId)===(a==null?void 0:a.printId)&&(typeof(a==null?void 0:a.callBack)=="function"&&a.callBack(n),(s=a.state==5||a.state==6)!=null||(c=(i=Q.removeAddListenerPrintList)==null?void 0:i[a==null?void 0:a.printId])==null||c.call(i))})})}catch(r){throw console.error("printFn error",r),r}};class it{constructor(){f(this,"printList");this.printList=[]}print(e){var n,a,i,c;const r=((a=(n=e==null?void 0:e.printParams)==null?void 0:n.functionId)!=null?a:"")+ot().replace(/-/g,"");if(this.printList.push({printId:r,callBack:e==null?void 0:e.callBack}),this.printList=this.printList.filter((s,w,u)=>w===u.findIndex(_=>_.printId===s.printId)),window.__MICRO_APP_ENVIRONMENT__){const{printParams:s,callBack:w}=e;return(c=(i=window.rawWindow.__mini_app_hook__)==null?void 0:i.print)==null||c.call(i,K(q({},s),{printId:r}),w),{id:r}}try{return cr.print(K(q({},e==null?void 0:e.printParams),{printId:r})),((s,w)=>{try{const{printParams:u}=s;at(w,u)}catch(u){throw console.error("createPrint error",u),u}})(K(q({},e),{printParams:K(q({},e.printParams),{printId:r})}),this),{id:r}}catch(s){throw console.error("printPlugin create error",s),s}}getStatus(){return o(this,null,function*(){try{return yield cr.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}const lr=typeof window!="undefined";let Ie=null;lr&&window.__MICRO_APP_ENVIRONMENT__&&(Ie=(Or=window.rawWindow.__mini_app_status_hook__)!=null?Or:{});const st=t=>{var e,r;if(!t)return"";try{const n=decodeURIComponent(t).match(/\/([^/?#&=]+)(?=$|[?&#])/g),a=(r=(e=n==null?void 0:n.pop())==null?void 0:e.slice(1))!=null?r:"",i=a.lastIndexOf(".");return i<=0?a:a.slice(0,i)}catch(n){return""}},dr=l.registerPlugin("DownloadFilePlugin",{web:new class extends P{downloadFile(t){return o(this,null,function*(){return((e,r,n="")=>({success:e,message:r,fileName:n}))(!1,"DownloadFilePlugin should be handled by shell",(e=>{var n;return((n=e==null?void 0:e.fileName)==null?void 0:n.trim())||`${st(e==null?void 0:e.url)}_${Date.now()}`})(t))})}getStatus(){try{return lr&&window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=Ie==null?void 0:Ie.downloadFile)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("downloadFile getStatus error",t),t}}}}),ct=typeof window!="undefined",lt=t=>{var r;const e=(r=t==null?void 0:t.fileName)==null?void 0:r.trim();return e||`${(n=>{var a,i;if(!n)return"";try{const c=decodeURIComponent(n).match(/\/([^/?#&=]+)(?=$|[?&#])/g),s=(i=(a=c==null?void 0:c.pop())==null?void 0:a.slice(1))!=null?i:"",w=s.lastIndexOf(".");return w<=0?s:s.slice(0,w)}catch(c){return""}})(t==null?void 0:t.url)}_${Date.now()}`},wr=(t,e)=>({success:!1,message:e,fileName:lt(t)});class dt{downloadFile(e){return o(this,null,function*(){try{if(ct&&window.__MICRO_APP_ENVIRONMENT__){const r=window.rawWindow.__mini_app_hook__.downloadFile;return r?yield r(e):wr(e,"DownloadFilePlugin is not available")}return yield dr.downloadFile(e)}catch(r){return console.error("downloadFile error",r),wr(e,r instanceof Error?r.message:"download failed")}})}getStatus(){return o(this,null,function*(){try{return yield dr.getStatus()}catch(e){throw console.error("downloadFile getStatus error",e),e}})}}class ur{constructor(){f(this,"initialContextPlugins",new Ur);f(this,"communicatePlugins",new Dr);f(this,"cameraScanPlugins",new jr);f(this,"cameraScanMultiplePlugins",new $r);f(this,"cameraScanMultipleNoCountPlugins",new qr);f(this,"cameraScanSingleOrDualPlugins",new Kr);f(this,"laserScanPlugins",new zr);f(this,"countAssistPlugins",new Jr);f(this,"clickStreamPlugins",new Gr);f(this,"lifecyclePlugins",new Qr);f(this,"deviceInteractionPlugins",new Xr);f(this,"pollingPlugins",new Yr);f(this,"paymentPlugins",new et);f(this,"cameraForTakePhotoPlugin",new rt);f(this,"httpPlugin",new tt);f(this,"printPlugins",new it);f(this,"downloadFilePlugin",new dt)}}const wt=new ur;let d=null,Ce=null;window.__MICRO_APP_ENVIRONMENT__&&(d=(Ar=window.rawWindow.__mini_app_hook__)!=null?Ar:{},Ce=(Lr=window.rawWindow.__mini_app_status_hook__)!=null?Lr:{});const ut=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends P{homeIsClick(t){return o(this,null,function*(){var e;window.__MICRO_APP_ENVIRONMENT__&&(console.log("window.microApp.forceDispatch homeIsClick",t),(e=d.disabledMenu)==null||e.call(d,t))})}openMiniApp(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=d.openMiniApp)==null||e.call(d,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("openMiniApp error",r),r}})}showTitle(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&(console.log("window.microApp.forceDispatch showTitle",t),(e=d.showTitle)==null||e.call(d,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("showTitle error",r),r}})}showFABMenu(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=d.showFABMenu)==null||e.call(d,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("showFABMenu error",r),r}})}disableFAB(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=d.disableFAB)==null||e.call(d,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("disableFAB error",r),r}})}disableBack(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=d.disableBack)==null||e.call(d,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("disableBack error",r),r}})}showSubMask(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=d.showSubMask)==null||e.call(d,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("showSubMask error",r),r}})}setMiniAppVersion(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=d.setMiniAppVersion)==null||e.call(d,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("setMiniAppVersion error",r),r}})}showDialog(){return o(this,null,function*(){var t;window.__MICRO_APP_ENVIRONMENT__&&((t=d.showDialog)==null||t.call(d))})}cancelDialog(){return o(this,null,function*(){var t;window.__MICRO_APP_ENVIRONMENT__&&((t=d.cancelDialog)==null||t.call(d))})}getMiniAppKong(t){return o(this,null,function*(){var e,r;try{if(window.__MICRO_APP_ENVIRONMENT__){const n=(r=(e=d.getMiniAppKong)==null?void 0:e.call(d,t))!=null?r:{};return new Promise(a=>{a(n)})}return new Promise(n=>{n(t)})}catch(n){throw console.error("getMiniAppKong error",n),n}})}closeMiniApp(){return o(this,null,function*(){var t;window.__MICRO_APP_ENVIRONMENT__&&((t=d.closeMiniApp)==null||t.call(d))})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=Ce==null?void 0:Ce.communicate)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("communicate getStatus error",t),t}}dispatchToShell(t){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(e=>o(this,null,function*(){var r;e((yield(r=d==null?void 0:d.dispatchToShell)==null?void 0:r.call(d,t))||{})})):new Promise(e=>{e(t)})}catch(e){throw console.error("communicate dispatchToShell error",e),e}}getMiniAppInfo(t){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(e=>o(this,null,function*(){var r;e((yield(r=d==null?void 0:d.getMiniAppInfo)==null?void 0:r.call(d,t))||{})})):new Promise(e=>{e({})})}catch(e){throw console.error("communicate getMiniAppInfo error",e),e}}}},Symbol.toStringTag,{value:"Module"}));N.NativeApi=ur,N.default=wt,Object.defineProperties(N,{__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.11.3",
4
+ "version": "1.11.4",
5
5
  "description": "In Superapp, the encapsulation of calling Native interfaces by mini-programs.",
6
6
  "scripts": {
7
7
  "dev": "vite",