superapp-miniapp-invoke-native 1.10.2 → 1.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/main.d.ts +0 -1
- package/lib/main.js +54 -57
- package/lib/main.umd.cjs +1 -1
- package/package.json +1 -1
package/lib/main.d.ts
CHANGED
package/lib/main.js
CHANGED
|
@@ -12,19 +12,19 @@ var Ce = (t, e, r) => e in t ? Lr(t, e, { enumerable: !0, configurable: !0, writ
|
|
|
12
12
|
}, T = (t, e) => Ar(t, Or(e));
|
|
13
13
|
var P = (t, e, r) => (Ce(t, typeof e != "symbol" ? e + "" : e, r), r);
|
|
14
14
|
var o = (t, e, r) => new Promise((n, a) => {
|
|
15
|
-
var i = (
|
|
15
|
+
var i = (w) => {
|
|
16
16
|
try {
|
|
17
|
-
s(r.next(
|
|
17
|
+
s(r.next(w));
|
|
18
18
|
} catch (u) {
|
|
19
19
|
a(u);
|
|
20
20
|
}
|
|
21
|
-
}, c = (
|
|
21
|
+
}, c = (w) => {
|
|
22
22
|
try {
|
|
23
|
-
s(r.throw(
|
|
23
|
+
s(r.throw(w));
|
|
24
24
|
} catch (u) {
|
|
25
25
|
a(u);
|
|
26
26
|
}
|
|
27
|
-
}, s = (
|
|
27
|
+
}, s = (w) => w.done ? n(w.value) : Promise.resolve(w.value).then(i, c);
|
|
28
28
|
s((r = r.apply(t, e)).next());
|
|
29
29
|
});
|
|
30
30
|
/*! Capacitor: https://capacitorjs.com/ - MIT License */
|
|
@@ -49,7 +49,7 @@ class ve extends Error {
|
|
|
49
49
|
}
|
|
50
50
|
const br = (t) => {
|
|
51
51
|
var e, r, n, a, i;
|
|
52
|
-
const c = t.CapacitorCustomPlatform || null, s = t.Capacitor || {},
|
|
52
|
+
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) => {
|
|
53
53
|
var m, N;
|
|
54
54
|
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";
|
|
55
55
|
})(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) => {
|
|
@@ -118,7 +118,7 @@ const br = (t) => {
|
|
|
118
118
|
return Ne(R);
|
|
119
119
|
}
|
|
120
120
|
} });
|
|
121
|
-
return
|
|
121
|
+
return w[h] = Me, I.set(h, { name: h, proxy: Me, platforms: /* @__PURE__ */ new Set([...Object.keys(m), ...$ ? [v] : []]) }), Me;
|
|
122
122
|
});
|
|
123
123
|
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 = ve, s.DEBUG = !!s.DEBUG, s.isLoggingEnabled = !!s.isLoggingEnabled, s.platform = s.getPlatform(), s.isNative = s.isNativePlatform(), s;
|
|
124
124
|
}, Tr = (t) => t.Capacitor = br(t), d = Tr(typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : typeof global != "undefined" ? global : {}), He = d.registerPlugin;
|
|
@@ -237,7 +237,7 @@ He("CapacitorCookies", { web: () => new Br() });
|
|
|
237
237
|
const Vr = (t, e = {}) => {
|
|
238
238
|
const r = Object.assign({ method: t.method || "GET", headers: t.headers }, e), n = ((a = {}) => {
|
|
239
239
|
const i = Object.keys(a);
|
|
240
|
-
return Object.keys(a).map((c) => c.toLocaleLowerCase()).reduce((c, s,
|
|
240
|
+
return Object.keys(a).map((c) => c.toLocaleLowerCase()).reduce((c, s, w) => (c[s] = a[i[w]], c), {});
|
|
241
241
|
})(t.headers)["content-type"] || "";
|
|
242
242
|
if (typeof t.data == "string")
|
|
243
243
|
r.body = t.data;
|
|
@@ -272,11 +272,11 @@ class Hr extends y {
|
|
|
272
272
|
m = f ? encodeURIComponent(v) : v, N += `${C}=${m}&`;
|
|
273
273
|
}), N.slice(0, -1)) : (m = f ? encodeURIComponent(h) : h, N = `${C}=${m}`), `${A}&${N}`;
|
|
274
274
|
}, "").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") || "";
|
|
275
|
-
let s,
|
|
275
|
+
let s, w, { responseType: u = "text" } = i.ok ? e : {};
|
|
276
276
|
switch (c.includes("application/json") && (u = "json"), u) {
|
|
277
277
|
case "arraybuffer":
|
|
278
278
|
case "blob":
|
|
279
|
-
|
|
279
|
+
w = yield i.blob(), s = yield ((p) => o(this, null, function* () {
|
|
280
280
|
return new Promise((f, A) => {
|
|
281
281
|
const I = new FileReader();
|
|
282
282
|
I.onload = () => {
|
|
@@ -284,7 +284,7 @@ class Hr extends y {
|
|
|
284
284
|
f(C.indexOf(",") >= 0 ? C.split(",")[1] : C);
|
|
285
285
|
}, I.onerror = (C) => A(C), I.readAsDataURL(p);
|
|
286
286
|
});
|
|
287
|
-
}))(
|
|
287
|
+
}))(w);
|
|
288
288
|
break;
|
|
289
289
|
case "json":
|
|
290
290
|
s = yield i.json();
|
|
@@ -445,8 +445,8 @@ const Fr = (t, e) => {
|
|
|
445
445
|
if ((r = g.showFABMenu) == null || r.call(g, { fabMenu: a, position: null }), !t || !((n = Object.keys(t)) != null && n.length))
|
|
446
446
|
return;
|
|
447
447
|
Object.keys(t).forEach((i) => {
|
|
448
|
-
var c, s,
|
|
449
|
-
a.push({ disable: (s = (c = t == null ? void 0 : t[i]) == null ? void 0 : c.disable) != null ? s : !1, icon: (u = (
|
|
448
|
+
var c, s, w, u, _, p, f, A;
|
|
449
|
+
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: (A = (f = t == null ? void 0 : t[i]) == null ? void 0 : f.title) != null ? A : "" });
|
|
450
450
|
}), queueMicrotask(() => {
|
|
451
451
|
var i;
|
|
452
452
|
(i = g.showFABMenu) == null || i.call(g, { fabMenu: a, position: e != null ? e : null });
|
|
@@ -455,7 +455,7 @@ const Fr = (t, e) => {
|
|
|
455
455
|
i && (re.removeAddListenerFab = yield ((c) => o(void 0, null, function* () {
|
|
456
456
|
try {
|
|
457
457
|
if (d.addListener) {
|
|
458
|
-
const s = yield d.addListener(E, "nativeSendFab", (
|
|
458
|
+
const s = yield d.addListener(E, "nativeSendFab", (w) => c && c(w));
|
|
459
459
|
return s != null && s.remove ? s.remove : () => null;
|
|
460
460
|
}
|
|
461
461
|
} catch (s) {
|
|
@@ -465,8 +465,8 @@ const Fr = (t, e) => {
|
|
|
465
465
|
}))((i) => {
|
|
466
466
|
let c;
|
|
467
467
|
i != null && i.disable || i != null && i.id && (Object.keys(t).forEach((s) => {
|
|
468
|
-
var
|
|
469
|
-
(
|
|
468
|
+
var w, u, _;
|
|
469
|
+
(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);
|
|
470
470
|
}), typeof c == "function" && c());
|
|
471
471
|
});
|
|
472
472
|
});
|
|
@@ -1452,10 +1452,10 @@ class Yr {
|
|
|
1452
1452
|
const { mounted: a, beforeUnmount: i, callBack: c } = r;
|
|
1453
1453
|
a(() => {
|
|
1454
1454
|
er((s) => o(this, null, function* () {
|
|
1455
|
-
var
|
|
1455
|
+
var w;
|
|
1456
1456
|
if (c && c instanceof Function)
|
|
1457
1457
|
try {
|
|
1458
|
-
(
|
|
1458
|
+
(w = c(s)) == null || w.then(() => o(this, null, function* () {
|
|
1459
1459
|
yield n.setNativeUsagePermission({ action: Q.MINI_APP_BEFORE_UNMOUNT_PERMISSION, value: !1 }), yield n.authorizeWebCallback({ action: Q.MINI_APP_BEFORE_UNMOUNT_COMPLETION });
|
|
1460
1460
|
}));
|
|
1461
1461
|
} catch (u) {
|
|
@@ -1597,21 +1597,21 @@ class zr {
|
|
|
1597
1597
|
if (window.__MICRO_APP_ENVIRONMENT__) {
|
|
1598
1598
|
const { mounted: i, pollingParams: c, callBack: s } = e;
|
|
1599
1599
|
return i(() => {
|
|
1600
|
-
var
|
|
1601
|
-
(u = (
|
|
1600
|
+
var w, u;
|
|
1601
|
+
(u = (w = window.rawWindow.__mini_app_hook__) == null ? void 0 : w.addPolling) == null || u.call(w, c, s);
|
|
1602
1602
|
}), () => {
|
|
1603
1603
|
this.destroy({ pollingId: c.pollingId });
|
|
1604
1604
|
};
|
|
1605
1605
|
}
|
|
1606
1606
|
try {
|
|
1607
|
-
(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,
|
|
1607
|
+
(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));
|
|
1608
1608
|
const i = ((a = e == null ? void 0 : e.pollingParams) == null ? void 0 : a.delay) / 1e3;
|
|
1609
1609
|
return Be.create(T(b({}, e == null ? void 0 : e.pollingParams), { delay: i })), ((c, s) => {
|
|
1610
1610
|
try {
|
|
1611
|
-
const { mounted:
|
|
1612
|
-
|
|
1613
|
-
} catch (
|
|
1614
|
-
throw console.error("createPolling error",
|
|
1611
|
+
const { mounted: w, pollingParams: u } = c;
|
|
1612
|
+
w(() => Xr(s, u));
|
|
1613
|
+
} catch (w) {
|
|
1614
|
+
throw console.error("createPolling error", w), w;
|
|
1615
1615
|
}
|
|
1616
1616
|
})(e, this), () => {
|
|
1617
1617
|
var c, s;
|
|
@@ -1801,9 +1801,9 @@ for (let t = 0; t < 256; ++t)
|
|
|
1801
1801
|
const nt = new Uint8Array(16);
|
|
1802
1802
|
function ot(t, e, r) {
|
|
1803
1803
|
return e || t || !crypto.randomUUID ? function(n, a, i) {
|
|
1804
|
-
var s,
|
|
1804
|
+
var s, w, u;
|
|
1805
1805
|
n = n || {};
|
|
1806
|
-
const c = (u = (
|
|
1806
|
+
const c = (u = (w = n.random) != null ? w : (s = n.rng) == null ? void 0 : s.call(n)) != null ? u : crypto.getRandomValues(nt);
|
|
1807
1807
|
if (c.length < 16)
|
|
1808
1808
|
throw new Error("Random bytes length must be >= 16");
|
|
1809
1809
|
if (c[6] = 15 & c[6] | 64, c[8] = 63 & c[8] | 128, a) {
|
|
@@ -1870,26 +1870,23 @@ class it {
|
|
|
1870
1870
|
this.printList = [];
|
|
1871
1871
|
}
|
|
1872
1872
|
print(e) {
|
|
1873
|
-
var n, a;
|
|
1873
|
+
var n, a, i, c;
|
|
1874
1874
|
const r = ((a = (n = e == null ? void 0 : e.printParams) == null ? void 0 : n.functionId) != null ? a : "") + ot().replace(/-/g, "");
|
|
1875
|
-
if (this.printList.push({ printId: r, callBack: e == null ? void 0 : e.callBack }), this.printList = this.printList.filter((
|
|
1876
|
-
const {
|
|
1877
|
-
return i
|
|
1878
|
-
var l, u;
|
|
1879
|
-
(u = (l = window.rawWindow.__mini_app_hook__) == null ? void 0 : l.print) == null || u.call(l, T(b({}, c), { printId: r }), s);
|
|
1880
|
-
}), { id: r };
|
|
1875
|
+
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__) {
|
|
1876
|
+
const { printParams: s, callBack: w } = e;
|
|
1877
|
+
return (c = (i = window.rawWindow.__mini_app_hook__) == null ? void 0 : i.print) == null || c.call(i, T(b({}, s), { printId: r }), w), { id: r };
|
|
1881
1878
|
}
|
|
1882
1879
|
try {
|
|
1883
|
-
return nr.print(T(b({}, e == null ? void 0 : e.printParams), { printId: r })), ((
|
|
1880
|
+
return nr.print(T(b({}, e == null ? void 0 : e.printParams), { printId: r })), ((s, w) => {
|
|
1884
1881
|
try {
|
|
1885
|
-
const {
|
|
1886
|
-
|
|
1887
|
-
} catch (
|
|
1888
|
-
throw console.error("createPrint error",
|
|
1882
|
+
const { printParams: u } = s;
|
|
1883
|
+
at(w, u);
|
|
1884
|
+
} catch (u) {
|
|
1885
|
+
throw console.error("createPrint error", u), u;
|
|
1889
1886
|
}
|
|
1890
1887
|
})(T(b({}, e), { printParams: T(b({}, e.printParams), { printId: r }) }), this), { id: r };
|
|
1891
|
-
} catch (
|
|
1892
|
-
throw console.error("printPlugin create error",
|
|
1888
|
+
} catch (s) {
|
|
1889
|
+
throw console.error("printPlugin create error", s), s;
|
|
1893
1890
|
}
|
|
1894
1891
|
}
|
|
1895
1892
|
getStatus() {
|
|
@@ -1923,21 +1920,21 @@ class st {
|
|
|
1923
1920
|
}
|
|
1924
1921
|
}
|
|
1925
1922
|
const wt = new st();
|
|
1926
|
-
let
|
|
1923
|
+
let l = null, Se = null;
|
|
1927
1924
|
var Pr, yr;
|
|
1928
|
-
window.__MICRO_APP_ENVIRONMENT__ && (
|
|
1925
|
+
window.__MICRO_APP_ENVIRONMENT__ && (l = (Pr = window.rawWindow.__mini_app_hook__) != null ? Pr : {}, Se = (yr = window.rawWindow.__mini_app_status_hook__) != null ? yr : {});
|
|
1929
1926
|
const ct = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: class extends y {
|
|
1930
1927
|
homeIsClick(t) {
|
|
1931
1928
|
return o(this, null, function* () {
|
|
1932
1929
|
var e;
|
|
1933
|
-
window.__MICRO_APP_ENVIRONMENT__ && (console.log("window.microApp.forceDispatch homeIsClick", t), (e =
|
|
1930
|
+
window.__MICRO_APP_ENVIRONMENT__ && (console.log("window.microApp.forceDispatch homeIsClick", t), (e = l.disabledMenu) == null || e.call(l, t));
|
|
1934
1931
|
});
|
|
1935
1932
|
}
|
|
1936
1933
|
openMiniApp(t) {
|
|
1937
1934
|
return o(this, null, function* () {
|
|
1938
1935
|
var e;
|
|
1939
1936
|
try {
|
|
1940
|
-
return window.__MICRO_APP_ENVIRONMENT__ && ((e =
|
|
1937
|
+
return window.__MICRO_APP_ENVIRONMENT__ && ((e = l.openMiniApp) == null || e.call(l, t)), new Promise((r) => {
|
|
1941
1938
|
r(t);
|
|
1942
1939
|
});
|
|
1943
1940
|
} catch (r) {
|
|
@@ -1949,7 +1946,7 @@ const ct = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
|
|
|
1949
1946
|
return o(this, null, function* () {
|
|
1950
1947
|
var e;
|
|
1951
1948
|
try {
|
|
1952
|
-
return window.__MICRO_APP_ENVIRONMENT__ && (console.log("window.microApp.forceDispatch showTitle", t), (e =
|
|
1949
|
+
return window.__MICRO_APP_ENVIRONMENT__ && (console.log("window.microApp.forceDispatch showTitle", t), (e = l.showTitle) == null || e.call(l, t)), new Promise((r) => {
|
|
1953
1950
|
r(t);
|
|
1954
1951
|
});
|
|
1955
1952
|
} catch (r) {
|
|
@@ -1961,7 +1958,7 @@ const ct = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
|
|
|
1961
1958
|
return o(this, null, function* () {
|
|
1962
1959
|
var e;
|
|
1963
1960
|
try {
|
|
1964
|
-
return window.__MICRO_APP_ENVIRONMENT__ && ((e =
|
|
1961
|
+
return window.__MICRO_APP_ENVIRONMENT__ && ((e = l.showFABMenu) == null || e.call(l, t)), new Promise((r) => {
|
|
1965
1962
|
r(t);
|
|
1966
1963
|
});
|
|
1967
1964
|
} catch (r) {
|
|
@@ -1973,7 +1970,7 @@ const ct = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
|
|
|
1973
1970
|
return o(this, null, function* () {
|
|
1974
1971
|
var e;
|
|
1975
1972
|
try {
|
|
1976
|
-
return window.__MICRO_APP_ENVIRONMENT__ && ((e =
|
|
1973
|
+
return window.__MICRO_APP_ENVIRONMENT__ && ((e = l.disableFAB) == null || e.call(l, t)), new Promise((r) => {
|
|
1977
1974
|
r(t);
|
|
1978
1975
|
});
|
|
1979
1976
|
} catch (r) {
|
|
@@ -1985,7 +1982,7 @@ const ct = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
|
|
|
1985
1982
|
return o(this, null, function* () {
|
|
1986
1983
|
var e;
|
|
1987
1984
|
try {
|
|
1988
|
-
return window.__MICRO_APP_ENVIRONMENT__ && ((e =
|
|
1985
|
+
return window.__MICRO_APP_ENVIRONMENT__ && ((e = l.disableBack) == null || e.call(l, t)), new Promise((r) => {
|
|
1989
1986
|
r(t);
|
|
1990
1987
|
});
|
|
1991
1988
|
} catch (r) {
|
|
@@ -1997,7 +1994,7 @@ const ct = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
|
|
|
1997
1994
|
return o(this, null, function* () {
|
|
1998
1995
|
var e;
|
|
1999
1996
|
try {
|
|
2000
|
-
return window.__MICRO_APP_ENVIRONMENT__ && ((e =
|
|
1997
|
+
return window.__MICRO_APP_ENVIRONMENT__ && ((e = l.showSubMask) == null || e.call(l, t)), new Promise((r) => {
|
|
2001
1998
|
r(t);
|
|
2002
1999
|
});
|
|
2003
2000
|
} catch (r) {
|
|
@@ -2009,7 +2006,7 @@ const ct = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
|
|
|
2009
2006
|
return o(this, null, function* () {
|
|
2010
2007
|
var e;
|
|
2011
2008
|
try {
|
|
2012
|
-
return window.__MICRO_APP_ENVIRONMENT__ && ((e =
|
|
2009
|
+
return window.__MICRO_APP_ENVIRONMENT__ && ((e = l.setMiniAppVersion) == null || e.call(l, t)), new Promise((r) => {
|
|
2013
2010
|
r(t);
|
|
2014
2011
|
});
|
|
2015
2012
|
} catch (r) {
|
|
@@ -2020,13 +2017,13 @@ const ct = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
|
|
|
2020
2017
|
showDialog() {
|
|
2021
2018
|
return o(this, null, function* () {
|
|
2022
2019
|
var t;
|
|
2023
|
-
window.__MICRO_APP_ENVIRONMENT__ && ((t =
|
|
2020
|
+
window.__MICRO_APP_ENVIRONMENT__ && ((t = l.showDialog) == null || t.call(l));
|
|
2024
2021
|
});
|
|
2025
2022
|
}
|
|
2026
2023
|
cancelDialog() {
|
|
2027
2024
|
return o(this, null, function* () {
|
|
2028
2025
|
var t;
|
|
2029
|
-
window.__MICRO_APP_ENVIRONMENT__ && ((t =
|
|
2026
|
+
window.__MICRO_APP_ENVIRONMENT__ && ((t = l.cancelDialog) == null || t.call(l));
|
|
2030
2027
|
});
|
|
2031
2028
|
}
|
|
2032
2029
|
getMiniAppKong(t) {
|
|
@@ -2034,7 +2031,7 @@ const ct = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
|
|
|
2034
2031
|
var e, r;
|
|
2035
2032
|
try {
|
|
2036
2033
|
if (window.__MICRO_APP_ENVIRONMENT__) {
|
|
2037
|
-
const n = (r = (e =
|
|
2034
|
+
const n = (r = (e = l.getMiniAppKong) == null ? void 0 : e.call(l, t)) != null ? r : {};
|
|
2038
2035
|
return new Promise((a) => {
|
|
2039
2036
|
a(n);
|
|
2040
2037
|
});
|
|
@@ -2050,7 +2047,7 @@ const ct = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
|
|
|
2050
2047
|
closeMiniApp() {
|
|
2051
2048
|
return o(this, null, function* () {
|
|
2052
2049
|
var t;
|
|
2053
|
-
window.__MICRO_APP_ENVIRONMENT__ && ((t =
|
|
2050
|
+
window.__MICRO_APP_ENVIRONMENT__ && ((t = l.closeMiniApp) == null || t.call(l));
|
|
2054
2051
|
});
|
|
2055
2052
|
}
|
|
2056
2053
|
getStatus() {
|
|
@@ -2069,7 +2066,7 @@ const ct = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
|
|
|
2069
2066
|
try {
|
|
2070
2067
|
return window.__MICRO_APP_ENVIRONMENT__ ? new Promise((e) => o(this, null, function* () {
|
|
2071
2068
|
var r;
|
|
2072
|
-
e((yield (r =
|
|
2069
|
+
e((yield (r = l == null ? void 0 : l.dispatchToShell) == null ? void 0 : r.call(l, t)) || {});
|
|
2073
2070
|
})) : new Promise((e) => {
|
|
2074
2071
|
e(t);
|
|
2075
2072
|
});
|
|
@@ -2081,7 +2078,7 @@ const ct = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
|
|
|
2081
2078
|
try {
|
|
2082
2079
|
return window.__MICRO_APP_ENVIRONMENT__ ? new Promise((e) => o(this, null, function* () {
|
|
2083
2080
|
var r;
|
|
2084
|
-
e((yield (r =
|
|
2081
|
+
e((yield (r = l == null ? void 0 : l.getMiniAppInfo) == null ? void 0 : r.call(l, t)) || {});
|
|
2085
2082
|
})) : new Promise((e) => {
|
|
2086
2083
|
e({});
|
|
2087
2084
|
});
|
package/lib/main.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var it=Object.defineProperty,st=Object.defineProperties;var ct=Object.getOwnPropertyDescriptors;var Or=Object.getOwnPropertySymbols;var lt=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable;var De=(N,g,S)=>g in N?it(N,g,{enumerable:!0,configurable:!0,writable:!0,value:S}):N[g]=S,q=(N,g)=>{for(var S in g||(g={}))lt.call(g,S)&&De(N,S,g[S]);if(Or)for(var S of Or(g))dt.call(g,S)&&De(N,S,g[S]);return N},K=(N,g)=>st(N,ct(g));var M=(N,g,S)=>(De(N,typeof g!="symbol"?g+"":g,S),S);var o=(N,g,S)=>new Promise((B,z)=>{var ve=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(ve,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 lr,dr,wr,ur,_r,hr,pr,mr,gr,Pr,yr,Sr,Nr,Mr,fr,Ir;"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 ve=t=>{var e,r,n,a,i;const c=t.CapacitorCustomPlatform||null,s=t.Capacitor||{},w=s.Plugins=s.Plugins||{},_=t.CapacitorPlatforms,u=((e=_==null?void 0:_.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=_==null?void 0:_.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||(()=>u()!=="web"),A=((n=_==null?void 0:_.currentPlatform)===null||n===void 0?void 0:n.isPluginAvailable)||(h=>{const m=L.get(h);return!!(m!=null&&m.platforms.has(u()))||!!b(h)}),b=((a=_==null?void 0:_.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)}),L=new Map,O=((i=_==null?void 0:_.currentPlatform)===null||i===void 0?void 0:i.registerPlugin)||((h,m={})=>{const I=L.get(h);if(I)return console.warn(`Capacitor plugin "${h}" already registered. Cannot register plugins twice.`),I.proxy;const E=u(),Z=b(h);let $;const Ue=T=>{let H;const J=(...Ce)=>{const Y=(()=>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(G=>{const Ar=((k,ee)=>{var We,xe;if(!Z){if(k)return(xe=k[ee])===null||xe===void 0?void 0:xe.bind(k);throw new z(`"${h}" plugin is not implemented on ${E}`,B.Unimplemented)}{const Lr=Z==null?void 0:Z.methods.find(re=>ee===re.name);if(Lr)return Lr.rtype==="promise"?re=>s.nativePromise(h,ee.toString(),re):(re,at)=>s.nativeCallback(h,ee.toString(),re,at);if(k)return(We=k[ee])===null||We===void 0?void 0:We.bind(k)}})(G,T);if(Ar){const k=Ar(...Ce);return H=k==null?void 0:k.remove,k}throw new z(`"${h}.${T}()" is not implemented on ${E}`,B.Unimplemented)});return T==="addListener"&&(Y.remove=()=>o(this,null,function*(){return H()})),Y};return J.toString=()=>`${T.toString()}() { [capacitor code] }`,Object.defineProperty(J,"name",{value:T,writable:!1,configurable:!1}),J},Cr=Ue("addListener"),vr=Ue("removeListener"),ot=(T,H)=>{const J=Cr({eventName:T},H),Ce=()=>o(this,null,function*(){const G=yield J;vr({eventName:T,callbackId:G},H)}),Y=new Promise(G=>J.then(()=>G({remove:Ce})));return Y.remove=()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield Ce()}),Y},Fe=new Proxy({},{get(T,H){switch(H){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return Z?ot:Cr;case"removeListener":return vr;default:return Ue(H)}}});return w[h]=Fe,L.set(h,{name:h,proxy:Fe,platforms:new Set([...Object.keys(m),...Z?[E]:[]])}),Fe});return s.convertFileSrc||(s.convertFileSrc=h=>h),s.getPlatform=u,s.handleError=h=>t.console.error(h),s.isNativePlatform=p,s.isPluginAvailable=A,s.pluginMethodNoop=(h,m,I)=>Promise.reject(`${I} does not have an implementation of "${m}".`),s.registerPlugin=O,s.Exception=z,s.DEBUG=!!s.DEBUG,s.isLoggingEnabled=!!s.isLoggingEnabled,s.platform=s.getPlatform(),s.isNative=s.isNativePlatform(),s},Ae=t=>t.Capacitor=ve(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 je=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),$e=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Er 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=$e(a).trim(),i=$e(i).trim(),r[a]=i}),r})}setCookie(e){return o(this,null,function*(){try{const r=je(e.key),n=je(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 Er});const kr=(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 Rr extends P{request(e){return o(this,null,function*(){const r=kr(e,e.webFetchExtra),n=((p,A=!0)=>p?Object.entries(p).reduce((b,L)=>{const[O,h]=L;let m,I;return Array.isArray(h)?(I="",h.forEach(E=>{m=A?encodeURIComponent(E):E,I+=`${O}=${m}&`}),I.slice(0,-1)):(m=A?encodeURIComponent(h):h,I=`${O}=${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:_="text"}=i.ok?e:{};switch(c.includes("application/json")&&(_="json"),_){case"arraybuffer":case"blob":w=yield i.blob(),s=yield(p=>o(this,null,function*(){return new Promise((A,b)=>{const L=new FileReader;L.onload=()=>{const O=L.result;A(O.indexOf(",")>=0?O.split(",")[1]:O)},L.onerror=O=>b(O),L.readAsDataURL(p)})}))(w);break;case"json":s=yield i.json();break;default:s=yield i.text()}const u={};return i.headers.forEach((p,A)=>{u[A]=p}),{data:s,headers:u,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 Rr}),v("Portals",{web:()=>Promise.resolve().then(function(){return br}).then(t=>new t.PortalsWeb)});const br=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 Tr{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}},R="CommunicatePlugin",y=l.registerPlugin(R,{web:()=>Promise.resolve().then(()=>nt).then(t=>new t.PluginsWeb)}),ne=C();ne.removeAddListenerFab=()=>null;const Br=(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,A,b;a.push({disable:(s=(c=t==null?void 0:t[i])==null?void 0:c.disable)!=null?s:!1,icon:(_=(w=t==null?void 0:t[i])==null?void 0:w.icon)!=null?_:"",id:(p=(u=t==null?void 0:t[i])==null?void 0:u.id)!=null?p:"",name:(b=(A=t==null?void 0:t[i])==null?void 0:A.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(R,"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:_.fn)!=null?u:()=>null)}),typeof c=="function"&&c())})})}catch(a){throw console.error("fabBtnHandle error",a),a}},V=C();V.addListenerBackRemoveHandle=()=>null;const qe=(t=()=>null)=>o(this,null,function*(){try{V!=null&&V.addListenerBackRemoveHandle&&typeof V.addListenerBackRemoveHandle=="function"&&V.addListenerBackRemoveHandle(),V.addListenerBackRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(R,"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 Hr=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(R,"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}},U=C();U.addListenerTouchRemoveHandle=()=>null;const Ke=(t=()=>null)=>o(this,null,function*(){try{U!=null&&U.addListenerTouchRemoveHandle&&typeof U.addListenerTouchRemoveHandle=="function"&&U.addListenerTouchRemoveHandle(),U.addListenerTouchRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(R,"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}}),F=C();F.addListenerSendDeepLinkRemoveHandle=()=>null;const ze=(t=()=>null)=>o(this,null,function*(){try{F!=null&&F.addListenerSendDeepLinkRemoveHandle&&typeof F.addListenerSendDeepLinkRemoveHandle=="function"&&F.addListenerSendDeepLinkRemoveHandle(),F.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(R,"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 Je=(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(R,"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(R,"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(R,"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 Vr{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(()=>{qe(i)}),a(()=>{qe()})}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:Hr(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):Br(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(()=>{Ke(i)}),a(()=>{Ke()})}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(()=>{ze(i)}),a(()=>{ze()})}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(()=>{Je(i)}),a(()=>{Je()})}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=(lr=window.rawWindow.__mini_app_status_hook__)!=null?lr:{});const Oe=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 Ur{pickCameraScan(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScan(e):yield Oe.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 Oe.setCameraScanState(e)}catch(r){throw console.error("setCameraScanState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Oe.getStatus()}catch(e){throw console.error("cameraScanPlugin getStatus error",e),e}})}}let ie=null;window.__MICRO_APP_ENVIRONMENT__&&(ie=(dr=window.rawWindow.__mini_app_status_hook__)!=null?dr:{});const Ee=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 Fr{pickCameraScanMultiple(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanMultiple(e):yield Ee.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 Ee.setCameraScanMultipleState(e)}catch(r){throw console.error("setCameraScanMultipleState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Ee.getStatus()}catch(e){throw console.error("cameraScanMultiplePlugin getStatus error",e),e}})}}let se=null;window.__MICRO_APP_ENVIRONMENT__&&(se=(wr=window.rawWindow.__mini_app_status_hook__)!=null?wr:{});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 Wr{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=(ur=window.rawWindow.__mini_app_status_hook__)!=null?ur:{});const Re=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 xr{pickCameraScanSingleOrDual(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanSingleOrDual(e):yield Re.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 Re.setCameraScanSingleOrDualState(e)}catch(r){throw console.error("setCameraScanSingleOrDualState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Re.getStatus()}catch(e){throw console.error("cameraScanSingleOrDualPlugin getStatus error",e),e}})}}const Ze="LaserScanPlugin";let le=null;window.__MICRO_APP_ENVIRONMENT__&&(le=(_r=window.rawWindow.__mini_app_status_hook__)!=null?_r:{});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 Dr{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 Ge="CountAssistPlugin";let ue=null;window.__MICRO_APP_ENVIRONMENT__&&(ue=(hr=window.rawWindow.__mini_app_status_hook__)!=null?hr:{});const _e=l.registerPlugin(Ge,{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 er=(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(Ge,"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(()=>{er(i)}),a(()=>{er()})}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=(pr=window.rawWindow.__mini_app_status_hook__)!=null?pr:{});const be=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 $r{constructor(){this.init()}init(){return o(this,null,function*(){try{return yield be.init()}catch(e){throw console.error("clickStreamPlugin, init error",e),e}})}trace(e){return o(this,null,function*(){try{return yield be.trace(e)}catch(r){throw console.error("clickStreamPlugin, trace error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield be.getStatus()}catch(e){throw console.error("clickStreamPlugin getStatus error",e),e}})}}const rr="MiniAppLifecyclePlugin";let pe=null;window.__MICRO_APP_ENVIRONMENT__&&(pe=(mr=window.rawWindow.__mini_app_status_hook__)!=null?mr:{});var Q=(t=>(t.MINI_APP_BEFORE_UNMOUNT_PERMISSION="mini_app_before_unmount_permission",t.MINI_APP_BEFORE_UNMOUNT_COMPLETION="mini_app_before_unmount_completion",t))(Q||{});const Te=l.registerPlugin(rr,{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 tr=(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(rr,"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 Te.setNativeUsagePermission(e)}catch(r){throw console.error("lifecyclePlugin.setNativeUsagePermission error",r),r}})}authorizeWebCallback(e){return o(this,null,function*(){try{return yield Te.authorizeWebCallback(e)}catch(r){throw console.error("lifecyclePlugin.authorizeWebCallback error",r),r}})}miniAppBeforeUnmount(e){this.setNativeUsagePermission({action:Q.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!0}),((r,n)=>{try{const{mounted:a,beforeUnmount:i,callBack:c}=r;a(()=>{tr(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:Q.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!1}),yield n.authorizeWebCallback({action:Q.MINI_APP_BEFORE_UNMOUNT_COMPLETION})}))}catch(_){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*(){tr(),n.setNativeUsagePermission({action:Q.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 Te.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let ge=null;window.__MICRO_APP_ENVIRONMENT__&&(ge=(gr=window.rawWindow.__mini_app_status_hook__)!=null?gr:{});const Be=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 Kr{callVibrate(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.callVibrate():yield Be.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 Be.callErrorBeep()}catch(e){throw console.error("callErrorBeep error",e),e}})}getStatus(){return o(this,null,function*(){try{return yield Be.getStatus()}catch(e){throw console.error("deviceInteractionPlugin getStatus error",e),e}})}}const nr="PollingPlugin";let Pe=null;window.__MICRO_APP_ENVIRONMENT__&&(Pe=(Pr=window.rawWindow.__mini_app_status_hook__)!=null?Pr:{});const He=l.registerPlugin(nr,{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(nr,"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 Jr{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 w,_;(_=(w=window.rawWindow.__mini_app_hook__)==null?void 0:w.addPolling)==null||_.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(_=>_.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:_}=c;w(()=>zr(s,_))}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=(yr=window.rawWindow.__mini_app_status_hook__)!=null?yr:{});const or=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 Qr{process(e){return o(this,null,function*(){try{return yield or.process(e)}catch(r){throw console.error("paymentPlugins.process error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield or.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let Ne=null;window.__MICRO_APP_ENVIRONMENT__&&(Ne=(Sr=window.rawWindow.__mini_app_status_hook__)!=null?Sr:{});const Ve=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 Xr{pickCameraForTakePhoto(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraForTakePhoto():yield Ve.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 Ve.setCameraForTakePhotoState(e)}catch(r){throw console.error("setCameraForTakePhotoState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Ve.getStatus()}catch(e){throw console.error("cameraForTakePhotoPlugin getStatus error",e),e}})}}let Me=null;window.__MICRO_APP_ENVIRONMENT__&&(Me=(Nr=window.rawWindow.__mini_app_status_hook__)!=null?Nr:{});const ar=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 Zr{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 ar.request(r)}}catch(r){throw console.error("HttpPlugin, trace error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield ar.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 Yr=new Uint8Array(16);function Gr(t,e,r){return e||t||!crypto.randomUUID?function(n,a,i){var s,w,_;n=n||{};const c=(_=(w=n.random)!=null?w:(s=n.rng)==null?void 0:s.call(n))!=null?_:crypto.getRandomValues(Yr);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 u=0;u<16;++u)a[i+u]=c[u];return a}return function(u,p=0){return(f[u[p+0]]+f[u[p+1]]+f[u[p+2]]+f[u[p+3]]+"-"+f[u[p+4]]+f[u[p+5]]+"-"+f[u[p+6]]+f[u[p+7]]+"-"+f[u[p+8]]+f[u[p+9]]+"-"+f[u[p+10]]+f[u[p+11]]+f[u[p+12]]+f[u[p+13]]+f[u[p+14]]+f[u[p+15]]).toLowerCase()}(c)}(t,e,r):crypto.randomUUID()}const ir="PrintPlugin";let fe=null;window.__MICRO_APP_ENVIRONMENT__&&(fe=(Mr=window.rawWindow.__mini_app_status_hook__)!=null?Mr:{});const sr=l.registerPlugin(ir,{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}}}}),X=C();X.removeAddListenerPrintList={};const et=(t,e)=>{try{const r=e.printId;X.removeAddListenerPrintList=K(q({},X.removeAddListenerPrintList),{printId:()=>{}}),(n=>o(this,null,function*(){return n&&(X.removeAddListenerPrintList[r]=yield(a=>o(this,null,function*(){try{if(l.addListener){const i=yield l.addListener(ir,"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=X.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 rt{constructor(){M(this,"printList");this.printList=[]}print(e){var n,a;const r=((a=(n=e==null?void 0:e.printParams)==null?void 0:n.functionId)!=null?a:"")+Gr().replace(/-/g,"");if(this.printList.push({printId:r,callBack:e==null?void 0:e.callBack}),this.printList=this.printList.filter((i,c,s)=>c===s.findIndex(w=>w.printId===i.printId)),window.__MICRO_APP_ENVIRONMENT__){const{mounted:i,printParams:c,callBack:s}=e;return i&&i(()=>{var w,_;(_=(w=window.rawWindow.__mini_app_hook__)==null?void 0:w.print)==null||_.call(w,K(q({},c),{printId:r}),s)}),{id:r}}try{return sr.print(K(q({},e==null?void 0:e.printParams),{printId:r})),((i,c)=>{try{const{mounted:s,printParams:w}=i;s&&s(()=>et(c,w))}catch(s){throw console.error("createPrint error",s),s}})(K(q({},e),{printParams:K(q({},e.printParams),{printId:r})}),this),{id:r}}catch(i){throw console.error("printPlugin create error",i),i}}getStatus(){return o(this,null,function*(){try{return yield sr.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}class cr{constructor(){M(this,"initialContextPlugins",new Tr);M(this,"communicatePlugins",new Vr);M(this,"cameraScanPlugins",new Ur);M(this,"cameraScanMultiplePlugins",new Fr);M(this,"cameraScanMultipleNoCountPlugins",new Wr);M(this,"cameraScanSingleOrDualPlugins",new xr);M(this,"laserScanPlugins",new Dr);M(this,"countAssistPlugins",new jr);M(this,"clickStreamPlugins",new $r);M(this,"lifecyclePlugins",new qr);M(this,"deviceInteractionPlugins",new Kr);M(this,"pollingPlugins",new Jr);M(this,"paymentPlugins",new Qr);M(this,"cameraForTakePhotoPlugin",new Xr);M(this,"httpPlugin",new Zr);M(this,"printPlugins",new rt)}}const tt=new cr;let d=null,Ie=null;window.__MICRO_APP_ENVIRONMENT__&&(d=(fr=window.rawWindow.__mini_app_hook__)!=null?fr:{},Ie=(Ir=window.rawWindow.__mini_app_status_hook__)!=null?Ir:{});const nt=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=Ie==null?void 0:Ie.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=cr,N.default=tt,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
var it=Object.defineProperty,st=Object.defineProperties;var ct=Object.getOwnPropertyDescriptors;var Or=Object.getOwnPropertySymbols;var lt=Object.prototype.hasOwnProperty,wt=Object.prototype.propertyIsEnumerable;var De=(N,g,S)=>g in N?it(N,g,{enumerable:!0,configurable:!0,writable:!0,value:S}):N[g]=S,q=(N,g)=>{for(var S in g||(g={}))lt.call(g,S)&&De(N,S,g[S]);if(Or)for(var S of Or(g))wt.call(g,S)&&De(N,S,g[S]);return N},K=(N,g)=>st(N,ct(g));var M=(N,g,S)=>(De(N,typeof g!="symbol"?g+"":g,S),S);var o=(N,g,S)=>new Promise((B,z)=>{var ve=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(ve,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 lr,wr,dr,ur,_r,hr,pr,mr,gr,Pr,yr,Sr,Nr,Mr,fr,Ir;"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 ve=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"),A=((n=u==null?void 0:u.currentPlatform)===null||n===void 0?void 0:n.isPluginAvailable)||(h=>{const m=L.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)}),L=new Map,O=((i=u==null?void 0:u.currentPlatform)===null||i===void 0?void 0:i.registerPlugin)||((h,m={})=>{const I=L.get(h);if(I)return console.warn(`Capacitor plugin "${h}" already registered. Cannot register plugins twice.`),I.proxy;const E=_(),Z=b(h);let $;const Ue=T=>{let H;const J=(...Ce)=>{const Y=(()=>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(G=>{const Ar=((k,ee)=>{var We,xe;if(!Z){if(k)return(xe=k[ee])===null||xe===void 0?void 0:xe.bind(k);throw new z(`"${h}" plugin is not implemented on ${E}`,B.Unimplemented)}{const Lr=Z==null?void 0:Z.methods.find(re=>ee===re.name);if(Lr)return Lr.rtype==="promise"?re=>s.nativePromise(h,ee.toString(),re):(re,at)=>s.nativeCallback(h,ee.toString(),re,at);if(k)return(We=k[ee])===null||We===void 0?void 0:We.bind(k)}})(G,T);if(Ar){const k=Ar(...Ce);return H=k==null?void 0:k.remove,k}throw new z(`"${h}.${T}()" is not implemented on ${E}`,B.Unimplemented)});return T==="addListener"&&(Y.remove=()=>o(this,null,function*(){return H()})),Y};return J.toString=()=>`${T.toString()}() { [capacitor code] }`,Object.defineProperty(J,"name",{value:T,writable:!1,configurable:!1}),J},Cr=Ue("addListener"),vr=Ue("removeListener"),ot=(T,H)=>{const J=Cr({eventName:T},H),Ce=()=>o(this,null,function*(){const G=yield J;vr({eventName:T,callbackId:G},H)}),Y=new Promise(G=>J.then(()=>G({remove:Ce})));return Y.remove=()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield Ce()}),Y},Fe=new Proxy({},{get(T,H){switch(H){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return Z?ot:Cr;case"removeListener":return vr;default:return Ue(H)}}});return d[h]=Fe,L.set(h,{name:h,proxy:Fe,platforms:new Set([...Object.keys(m),...Z?[E]:[]])}),Fe});return s.convertFileSrc||(s.convertFileSrc=h=>h),s.getPlatform=_,s.handleError=h=>t.console.error(h),s.isNativePlatform=p,s.isPluginAvailable=A,s.pluginMethodNoop=(h,m,I)=>Promise.reject(`${I} does not have an implementation of "${m}".`),s.registerPlugin=O,s.Exception=z,s.DEBUG=!!s.DEBUG,s.isLoggingEnabled=!!s.isLoggingEnabled,s.platform=s.getPlatform(),s.isNative=s.isNativePlatform(),s},Ae=t=>t.Capacitor=ve(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 je=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),$e=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Er 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=$e(a).trim(),i=$e(i).trim(),r[a]=i}),r})}setCookie(e){return o(this,null,function*(){try{const r=je(e.key),n=je(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 Er});const kr=(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 Rr extends P{request(e){return o(this,null,function*(){const r=kr(e,e.webFetchExtra),n=((p,A=!0)=>p?Object.entries(p).reduce((b,L)=>{const[O,h]=L;let m,I;return Array.isArray(h)?(I="",h.forEach(E=>{m=A?encodeURIComponent(E):E,I+=`${O}=${m}&`}),I.slice(0,-1)):(m=A?encodeURIComponent(h):h,I=`${O}=${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((A,b)=>{const L=new FileReader;L.onload=()=>{const O=L.result;A(O.indexOf(",")>=0?O.split(",")[1]:O)},L.onerror=O=>b(O),L.readAsDataURL(p)})}))(d);break;case"json":s=yield i.json();break;default:s=yield i.text()}const _={};return i.headers.forEach((p,A)=>{_[A]=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 Rr}),v("Portals",{web:()=>Promise.resolve().then(function(){return br}).then(t=>new t.PortalsWeb)});const br=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 Tr{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}},R="CommunicatePlugin",y=l.registerPlugin(R,{web:()=>Promise.resolve().then(()=>nt).then(t=>new t.PluginsWeb)}),ne=C();ne.removeAddListenerFab=()=>null;const Br=(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,A,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=(A=t==null?void 0:t[i])==null?void 0:A.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(R,"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}},V=C();V.addListenerBackRemoveHandle=()=>null;const qe=(t=()=>null)=>o(this,null,function*(){try{V!=null&&V.addListenerBackRemoveHandle&&typeof V.addListenerBackRemoveHandle=="function"&&V.addListenerBackRemoveHandle(),V.addListenerBackRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(R,"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 Hr=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(R,"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}},U=C();U.addListenerTouchRemoveHandle=()=>null;const Ke=(t=()=>null)=>o(this,null,function*(){try{U!=null&&U.addListenerTouchRemoveHandle&&typeof U.addListenerTouchRemoveHandle=="function"&&U.addListenerTouchRemoveHandle(),U.addListenerTouchRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(R,"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}}),F=C();F.addListenerSendDeepLinkRemoveHandle=()=>null;const ze=(t=()=>null)=>o(this,null,function*(){try{F!=null&&F.addListenerSendDeepLinkRemoveHandle&&typeof F.addListenerSendDeepLinkRemoveHandle=="function"&&F.addListenerSendDeepLinkRemoveHandle(),F.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(R,"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 Je=(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(R,"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(R,"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(R,"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 Vr{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(()=>{qe(i)}),a(()=>{qe()})}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:Hr(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):Br(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(()=>{Ke(i)}),a(()=>{Ke()})}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(()=>{ze(i)}),a(()=>{ze()})}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(()=>{Je(i)}),a(()=>{Je()})}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=(lr=window.rawWindow.__mini_app_status_hook__)!=null?lr:{});const Oe=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 Ur{pickCameraScan(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScan(e):yield Oe.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 Oe.setCameraScanState(e)}catch(r){throw console.error("setCameraScanState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Oe.getStatus()}catch(e){throw console.error("cameraScanPlugin getStatus error",e),e}})}}let ie=null;window.__MICRO_APP_ENVIRONMENT__&&(ie=(wr=window.rawWindow.__mini_app_status_hook__)!=null?wr:{});const Ee=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 Fr{pickCameraScanMultiple(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanMultiple(e):yield Ee.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 Ee.setCameraScanMultipleState(e)}catch(r){throw console.error("setCameraScanMultipleState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Ee.getStatus()}catch(e){throw console.error("cameraScanMultiplePlugin getStatus error",e),e}})}}let se=null;window.__MICRO_APP_ENVIRONMENT__&&(se=(dr=window.rawWindow.__mini_app_status_hook__)!=null?dr:{});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 Wr{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=(ur=window.rawWindow.__mini_app_status_hook__)!=null?ur:{});const Re=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 xr{pickCameraScanSingleOrDual(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanSingleOrDual(e):yield Re.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 Re.setCameraScanSingleOrDualState(e)}catch(r){throw console.error("setCameraScanSingleOrDualState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Re.getStatus()}catch(e){throw console.error("cameraScanSingleOrDualPlugin getStatus error",e),e}})}}const Ze="LaserScanPlugin";let le=null;window.__MICRO_APP_ENVIRONMENT__&&(le=(_r=window.rawWindow.__mini_app_status_hook__)!=null?_r:{});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 Dr{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 Ge="CountAssistPlugin";let ue=null;window.__MICRO_APP_ENVIRONMENT__&&(ue=(hr=window.rawWindow.__mini_app_status_hook__)!=null?hr:{});const _e=l.registerPlugin(Ge,{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 er=(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(Ge,"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(()=>{er(i)}),a(()=>{er()})}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=(pr=window.rawWindow.__mini_app_status_hook__)!=null?pr:{});const be=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 $r{constructor(){this.init()}init(){return o(this,null,function*(){try{return yield be.init()}catch(e){throw console.error("clickStreamPlugin, init error",e),e}})}trace(e){return o(this,null,function*(){try{return yield be.trace(e)}catch(r){throw console.error("clickStreamPlugin, trace error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield be.getStatus()}catch(e){throw console.error("clickStreamPlugin getStatus error",e),e}})}}const rr="MiniAppLifecyclePlugin";let pe=null;window.__MICRO_APP_ENVIRONMENT__&&(pe=(mr=window.rawWindow.__mini_app_status_hook__)!=null?mr:{});var Q=(t=>(t.MINI_APP_BEFORE_UNMOUNT_PERMISSION="mini_app_before_unmount_permission",t.MINI_APP_BEFORE_UNMOUNT_COMPLETION="mini_app_before_unmount_completion",t))(Q||{});const Te=l.registerPlugin(rr,{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 tr=(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(rr,"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 Te.setNativeUsagePermission(e)}catch(r){throw console.error("lifecyclePlugin.setNativeUsagePermission error",r),r}})}authorizeWebCallback(e){return o(this,null,function*(){try{return yield Te.authorizeWebCallback(e)}catch(r){throw console.error("lifecyclePlugin.authorizeWebCallback error",r),r}})}miniAppBeforeUnmount(e){this.setNativeUsagePermission({action:Q.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!0}),((r,n)=>{try{const{mounted:a,beforeUnmount:i,callBack:c}=r;a(()=>{tr(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:Q.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!1}),yield n.authorizeWebCallback({action:Q.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*(){tr(),n.setNativeUsagePermission({action:Q.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 Te.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let ge=null;window.__MICRO_APP_ENVIRONMENT__&&(ge=(gr=window.rawWindow.__mini_app_status_hook__)!=null?gr:{});const Be=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 Kr{callVibrate(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.callVibrate():yield Be.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 Be.callErrorBeep()}catch(e){throw console.error("callErrorBeep error",e),e}})}getStatus(){return o(this,null,function*(){try{return yield Be.getStatus()}catch(e){throw console.error("deviceInteractionPlugin getStatus error",e),e}})}}const nr="PollingPlugin";let Pe=null;window.__MICRO_APP_ENVIRONMENT__&&(Pe=(Pr=window.rawWindow.__mini_app_status_hook__)!=null?Pr:{});const He=l.registerPlugin(nr,{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(nr,"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 Jr{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=(yr=window.rawWindow.__mini_app_status_hook__)!=null?yr:{});const or=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 Qr{process(e){return o(this,null,function*(){try{return yield or.process(e)}catch(r){throw console.error("paymentPlugins.process error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield or.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let Ne=null;window.__MICRO_APP_ENVIRONMENT__&&(Ne=(Sr=window.rawWindow.__mini_app_status_hook__)!=null?Sr:{});const Ve=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 Xr{pickCameraForTakePhoto(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraForTakePhoto():yield Ve.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 Ve.setCameraForTakePhotoState(e)}catch(r){throw console.error("setCameraForTakePhotoState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Ve.getStatus()}catch(e){throw console.error("cameraForTakePhotoPlugin getStatus error",e),e}})}}let Me=null;window.__MICRO_APP_ENVIRONMENT__&&(Me=(Nr=window.rawWindow.__mini_app_status_hook__)!=null?Nr:{});const ar=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 Zr{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 ar.request(r)}}catch(r){throw console.error("HttpPlugin, trace error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield ar.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 Yr=new Uint8Array(16);function Gr(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(Yr);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 ir="PrintPlugin";let fe=null;window.__MICRO_APP_ENVIRONMENT__&&(fe=(Mr=window.rawWindow.__mini_app_status_hook__)!=null?Mr:{});const sr=l.registerPlugin(ir,{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}}}}),X=C();X.removeAddListenerPrintList={};const et=(t,e)=>{try{const r=e.printId;X.removeAddListenerPrintList=K(q({},X.removeAddListenerPrintList),{printId:()=>{}}),(n=>o(this,null,function*(){return n&&(X.removeAddListenerPrintList[r]=yield(a=>o(this,null,function*(){try{if(l.addListener){const i=yield l.addListener(ir,"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=X.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 rt{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:"")+Gr().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 sr.print(K(q({},e==null?void 0:e.printParams),{printId:r})),((s,d)=>{try{const{printParams:u}=s;et(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 sr.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}class cr{constructor(){M(this,"initialContextPlugins",new Tr);M(this,"communicatePlugins",new Vr);M(this,"cameraScanPlugins",new Ur);M(this,"cameraScanMultiplePlugins",new Fr);M(this,"cameraScanMultipleNoCountPlugins",new Wr);M(this,"cameraScanSingleOrDualPlugins",new xr);M(this,"laserScanPlugins",new Dr);M(this,"countAssistPlugins",new jr);M(this,"clickStreamPlugins",new $r);M(this,"lifecyclePlugins",new qr);M(this,"deviceInteractionPlugins",new Kr);M(this,"pollingPlugins",new Jr);M(this,"paymentPlugins",new Qr);M(this,"cameraForTakePhotoPlugin",new Xr);M(this,"httpPlugin",new Zr);M(this,"printPlugins",new rt)}}const tt=new cr;let w=null,Ie=null;window.__MICRO_APP_ENVIRONMENT__&&(w=(fr=window.rawWindow.__mini_app_hook__)!=null?fr:{},Ie=(Ir=window.rawWindow.__mini_app_status_hook__)!=null?Ir:{});const nt=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=Ie==null?void 0:Ie.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=cr,N.default=tt,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED