@docoi/mys-sdk 1.1.0 → 1.2.0
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/README.md +1 -1
- package/dist/api/biz.d.ts +21 -23
- package/dist/api/router/index.d.ts +1 -1
- package/dist/api/router/routes.d.ts +40 -0
- package/dist/index.mjs +543 -508
- package/dist/types/enums.d.ts +3 -1
- package/dist/types/params.d.ts +7 -1
- package/dist/types/results.d.ts +14 -1
- package/dist/types/router.d.ts +13 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import We from "@docoi/jsbridge-sdk";
|
|
2
|
+
const Pe = 0, re = -1, Ge = 1001, Ve = 1002, Zt = 2002, er = 3002, nr = 4002, z = 5001, Je = 5002, Ie = 9002, tr = 9101, rr = 9102;
|
|
3
3
|
function f(e) {
|
|
4
4
|
return typeof e == "string";
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function Ee(e) {
|
|
7
7
|
return typeof e == "number";
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function P(e) {
|
|
10
10
|
return typeof e == "object" && e !== null;
|
|
11
11
|
}
|
|
12
12
|
function O(e) {
|
|
13
|
-
if (!
|
|
13
|
+
if (!P(e) || Object.prototype.toString.call(e) !== "[object Object]") return !1;
|
|
14
14
|
const n = Object.getPrototypeOf(e);
|
|
15
15
|
return n === null || Object.getPrototypeOf(n) === null;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function Ke(e) {
|
|
18
18
|
return f(e) && /^\d+(\.\d+){1,3}$/.test(e);
|
|
19
19
|
}
|
|
20
|
-
const
|
|
21
|
-
function
|
|
22
|
-
return f(e) && (
|
|
20
|
+
const ze = /^data:image\/[\w.+-]+;base64,[A-Za-z0-9+/]/i, Ye = /^[A-Za-z0-9+/]+={0,2}$/;
|
|
21
|
+
function Xe(e) {
|
|
22
|
+
return f(e) && (ze.test(e) || Ye.test(e));
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function ke(e, n = null) {
|
|
25
25
|
try {
|
|
26
26
|
return JSON.parse(e);
|
|
27
27
|
} catch (t) {
|
|
28
28
|
return n;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function ae(e) {
|
|
32
32
|
try {
|
|
33
33
|
return decodeURIComponent(e);
|
|
34
34
|
} catch (n) {
|
|
@@ -38,7 +38,7 @@ function ce(e) {
|
|
|
38
38
|
function m(e) {
|
|
39
39
|
if (f(e)) return e;
|
|
40
40
|
if (e instanceof Error) return e.message || "system error";
|
|
41
|
-
if (
|
|
41
|
+
if (P(e)) {
|
|
42
42
|
if (f(e.errMsg)) return e.errMsg;
|
|
43
43
|
if (f(e.msg)) return e.msg;
|
|
44
44
|
if (f(e.message)) return e.message;
|
|
@@ -47,18 +47,18 @@ function m(e) {
|
|
|
47
47
|
}
|
|
48
48
|
class T extends Error {
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Qe(e, n) {
|
|
51
51
|
if (typeof e == "bigint") throw new T(`${n} 是 BigInt,不能传给 Native`);
|
|
52
52
|
if (e instanceof Map || e instanceof Set) throw new T(`${n} 是 ${e.constructor.name},不能传给 Native`);
|
|
53
53
|
if (typeof ArrayBuffer != "undefined" && (e instanceof ArrayBuffer || ArrayBuffer.isView(e)))
|
|
54
54
|
throw new T(`${n} 是二进制数据,不能传给 Native`);
|
|
55
55
|
if (typeof Blob != "undefined" && e instanceof Blob) throw new T(`${n} 是 Blob,不能传给 Native`);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
const n = JSON.stringify(e, (t, r) => (t &&
|
|
57
|
+
function F(e) {
|
|
58
|
+
const n = JSON.stringify(e, (t, r) => (t && Qe(r, t), r));
|
|
59
59
|
return n === void 0 ? void 0 : JSON.parse(n);
|
|
60
60
|
}
|
|
61
|
-
const
|
|
61
|
+
const I = {
|
|
62
62
|
/** iOS 调用通道 */
|
|
63
63
|
iosInvoke: "jsbridge",
|
|
64
64
|
/** iOS 上 H5 异步回调的回传通道 */
|
|
@@ -69,79 +69,79 @@ const E = {
|
|
|
69
69
|
globalInvoke: "JSBridgeInvoke",
|
|
70
70
|
/** 回调 ID 前缀,1.0.0 为 cb_ */
|
|
71
71
|
callbackIdPrefix: "cb"
|
|
72
|
-
},
|
|
73
|
-
class
|
|
72
|
+
}, Ze = "[jsbridge]";
|
|
73
|
+
class W extends Error {
|
|
74
74
|
constructor(n, t) {
|
|
75
75
|
super(t), this.kind = n;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
const
|
|
79
|
-
let
|
|
78
|
+
const Y = { error: 1, warn: 2, info: 3, debug: 4 };
|
|
79
|
+
let Ce = !1, Se = "info", Ae = !0;
|
|
80
80
|
function g(e, ...n) {
|
|
81
|
-
!
|
|
81
|
+
!Ce || !Ae || Y[e] > Y[Se] || console[e](`${Ze} [${e.toUpperCase()}]`, ...n);
|
|
82
82
|
}
|
|
83
|
-
let
|
|
84
|
-
const
|
|
85
|
-
function
|
|
83
|
+
let en = 1;
|
|
84
|
+
const G = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), le = /* @__PURE__ */ new Map();
|
|
85
|
+
function qe(e) {
|
|
86
86
|
var t, r;
|
|
87
87
|
const n = (r = (t = window.webkit) == null ? void 0 : t.messageHandlers) == null ? void 0 : r[e];
|
|
88
88
|
return typeof (n == null ? void 0 : n.postMessage) == "function" ? n : void 0;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function _e() {
|
|
91
91
|
return window.JSBridgeNative;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
const n =
|
|
93
|
+
function nn(e) {
|
|
94
|
+
const n = qe(I.iosInvoke);
|
|
95
95
|
if (n) {
|
|
96
96
|
n.postMessage(e);
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
|
-
const t =
|
|
99
|
+
const t = _e();
|
|
100
100
|
if (t && typeof t.call == "function") {
|
|
101
101
|
t.call(JSON.stringify(e));
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
throw new
|
|
104
|
+
throw new W("communication", "当前环境不支持调用原生方法");
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
return `${
|
|
106
|
+
function tn() {
|
|
107
|
+
return `${I.callbackIdPrefix}_${Date.now()}_${en++}`;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
return
|
|
109
|
+
function rn(e) {
|
|
110
|
+
return P(e) && !!e.error;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function fe(e, n) {
|
|
113
113
|
return new Promise((t, r) => {
|
|
114
|
-
const i =
|
|
115
|
-
|
|
116
|
-
if (
|
|
117
|
-
r(new
|
|
114
|
+
const i = tn();
|
|
115
|
+
G.set(i, (o) => {
|
|
116
|
+
if (rn(o)) {
|
|
117
|
+
r(new W("native", m(o.error)));
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
120
|
t(o);
|
|
121
121
|
}), g("debug", `调用原生方法: ${e}`, n);
|
|
122
122
|
try {
|
|
123
|
-
|
|
123
|
+
nn({ method: e, params: n, callbackId: i });
|
|
124
124
|
} catch (o) {
|
|
125
|
-
|
|
125
|
+
G.delete(i), r(new W("communication", m(o)));
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
const t =
|
|
131
|
-
return
|
|
129
|
+
function on(e, n) {
|
|
130
|
+
const t = le.get(e), r = t ? t.then(n, n) : n();
|
|
131
|
+
return le.set(e, r.then(ge, ge)), r;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function ge() {
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
return
|
|
135
|
+
function un(e, n, t) {
|
|
136
|
+
return Q(), (t == null ? void 0 : t.queue) === "serial" ? on(e, () => fe(e, n)) : fe(e, n);
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function sn(e, n) {
|
|
139
139
|
if (!e) {
|
|
140
140
|
g("warn", "无效的回调ID");
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
143
|
g("debug", `接收到回调: ${e}`, n);
|
|
144
|
-
const t =
|
|
144
|
+
const t = G.get(e);
|
|
145
145
|
if (!t) {
|
|
146
146
|
g("warn", `未找到回调: ${e}`);
|
|
147
147
|
return;
|
|
@@ -151,10 +151,10 @@ function on(e, n) {
|
|
|
151
151
|
} catch (r) {
|
|
152
152
|
g("error", `回调执行错误: ${e}`, r);
|
|
153
153
|
} finally {
|
|
154
|
-
|
|
154
|
+
G.delete(e);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function cn(e, n) {
|
|
158
158
|
g("debug", `接收到事件: ${e}`, n);
|
|
159
159
|
const t = M.get(e);
|
|
160
160
|
if (t != null && t.length)
|
|
@@ -165,60 +165,60 @@ function un(e, n) {
|
|
|
165
165
|
g("warn", `事件处理器执行错误: ${e}`, i);
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function dn(e) {
|
|
169
169
|
return JSON.stringify({ success: !0, data: e });
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function ye(e) {
|
|
172
172
|
return JSON.stringify({ success: !1, error: e });
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function he(e, n) {
|
|
175
175
|
g("debug", `调用原生回调: ${e}`, n);
|
|
176
|
-
const t =
|
|
176
|
+
const t = qe(I.iosCallback);
|
|
177
177
|
if (t) {
|
|
178
178
|
t.postMessage({ callbackId: e, data: n });
|
|
179
179
|
return;
|
|
180
180
|
}
|
|
181
|
-
const r =
|
|
181
|
+
const r = _e();
|
|
182
182
|
r && typeof r.callback == "function" && r.callback(e, JSON.stringify(n));
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function an(e, n, t) {
|
|
185
185
|
g("debug", `接收到原生调用: ${e}`, n);
|
|
186
|
-
const r =
|
|
186
|
+
const r = X.get(e);
|
|
187
187
|
if (!r) {
|
|
188
188
|
const i = `方法 ${e} 未注册`;
|
|
189
|
-
return g("error", i),
|
|
189
|
+
return g("error", i), ye({ code: -1, message: i });
|
|
190
190
|
}
|
|
191
191
|
try {
|
|
192
192
|
const i = r(n);
|
|
193
193
|
return i && typeof i.then == "function" ? t ? (i.then(
|
|
194
|
-
(o) =>
|
|
195
|
-
(o) =>
|
|
194
|
+
(o) => he(t, { success: !0, data: o }),
|
|
195
|
+
(o) => he(t, {
|
|
196
196
|
success: !1,
|
|
197
197
|
error: { message: m(o) }
|
|
198
198
|
})
|
|
199
|
-
), null) : (g("warn", `异步方法 ${e} 没有 callbackId,结果无法回传`), null) :
|
|
199
|
+
), null) : (g("warn", `异步方法 ${e} 没有 callbackId,结果无法回传`), null) : dn(i);
|
|
200
200
|
} catch (i) {
|
|
201
201
|
const o = m(i);
|
|
202
|
-
return g("error", `方法执行错误: ${e}`, o),
|
|
202
|
+
return g("error", `方法执行错误: ${e}`, o), ye({ message: o });
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function ln() {
|
|
206
206
|
if (typeof window == "undefined") return;
|
|
207
207
|
const e = window;
|
|
208
|
-
typeof e[
|
|
208
|
+
typeof e[I.globalEvent] != "function" && (e[I.globalEvent] = () => {
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
|
-
let
|
|
212
|
-
function
|
|
213
|
-
if (
|
|
214
|
-
|
|
211
|
+
let pe = !1;
|
|
212
|
+
function Q() {
|
|
213
|
+
if (pe) return;
|
|
214
|
+
pe = !0;
|
|
215
215
|
const e = window;
|
|
216
|
-
e[
|
|
216
|
+
e[I.globalCallback] = (n, t) => sn(n, t), e[I.globalEvent] = (n, t) => cn(n, t), e[I.globalInvoke] = (n, t, r) => an(n, t, r), g("info", "初始化完成");
|
|
217
217
|
}
|
|
218
218
|
const _ = {
|
|
219
|
-
callAsync:
|
|
219
|
+
callAsync: un,
|
|
220
220
|
on(e, n) {
|
|
221
|
-
|
|
221
|
+
Q();
|
|
222
222
|
const t = M.get(e);
|
|
223
223
|
if (!t) {
|
|
224
224
|
M.set(e, [n]);
|
|
@@ -233,43 +233,43 @@ const _ = {
|
|
|
233
233
|
r !== -1 && (t.splice(r, 1), t.length || M.delete(e));
|
|
234
234
|
},
|
|
235
235
|
register(e, n) {
|
|
236
|
-
|
|
236
|
+
Q(), X.set(e, n);
|
|
237
237
|
},
|
|
238
238
|
unregister(e) {
|
|
239
|
-
|
|
239
|
+
X.delete(e);
|
|
240
240
|
},
|
|
241
241
|
setDebug(e, n) {
|
|
242
|
-
|
|
242
|
+
Ce = e, n != null && n.logLevel && n.logLevel in Y && (Se = n.logLevel), typeof (n == null ? void 0 : n.useConsole) == "boolean" && (Ae = n.useConsole);
|
|
243
243
|
}
|
|
244
244
|
};
|
|
245
|
-
let
|
|
246
|
-
function
|
|
247
|
-
return O(e) &&
|
|
245
|
+
let k;
|
|
246
|
+
function be(e) {
|
|
247
|
+
return O(e) && Ke(e.app_version);
|
|
248
248
|
}
|
|
249
|
-
function
|
|
249
|
+
function fn(e) {
|
|
250
250
|
const n = /#webBaseInfo(.*?[^\\])#/.exec(e);
|
|
251
|
-
return n != null && n[1] ?
|
|
251
|
+
return n != null && n[1] ? ke(n[1]) : null;
|
|
252
252
|
}
|
|
253
253
|
function B() {
|
|
254
|
-
if (
|
|
254
|
+
if (k !== void 0) return k;
|
|
255
255
|
if (typeof window == "undefined") return null;
|
|
256
256
|
const e = window, n = e._appBaseInfo;
|
|
257
257
|
if (n !== void 0)
|
|
258
|
-
return
|
|
258
|
+
return k = be(n) ? n : null, k;
|
|
259
259
|
if (typeof navigator == "undefined") return null;
|
|
260
|
-
const t = navigator.userAgent.replace(/ +/g, "").replace(/[\r\n]/g, ""), r =
|
|
261
|
-
return
|
|
260
|
+
const t = navigator.userAgent.replace(/ +/g, "").replace(/[\r\n]/g, ""), r = fn(t);
|
|
261
|
+
return k = be(r) ? r : null, e._appBaseInfo = k, k;
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function Oe() {
|
|
264
264
|
return !!B();
|
|
265
265
|
}
|
|
266
|
-
function
|
|
267
|
-
return !!e &&
|
|
266
|
+
function Re(e) {
|
|
267
|
+
return !!e && gn(e) === -1;
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function Te() {
|
|
270
270
|
return typeof window == "undefined" ? 1 : window.devicePixelRatio || 1;
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function gn(e, n = ((t) => (t = B()) == null ? void 0 : t.app_version)() || "") {
|
|
273
273
|
if (!e && !n) return 0;
|
|
274
274
|
if (!e) return 1;
|
|
275
275
|
if (!n) return -1;
|
|
@@ -284,201 +284,201 @@ function ln(e, n = ((t) => (t = B()) == null ? void 0 : t.app_version)() || "")
|
|
|
284
284
|
}
|
|
285
285
|
return 0;
|
|
286
286
|
}
|
|
287
|
-
const
|
|
288
|
-
function
|
|
287
|
+
const me = "docoi-web-community-frame";
|
|
288
|
+
function Me() {
|
|
289
289
|
if (typeof navigator == "undefined") return "unknown";
|
|
290
290
|
const e = navigator.userAgent;
|
|
291
291
|
return /\(i[^;]+;( U;)? CPU.+Mac OS X/.test(e) ? "ios" : e.includes("Android") || e.includes("Linux") ? "android" : "unknown";
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function yn() {
|
|
294
294
|
if (typeof window == "undefined") return !1;
|
|
295
295
|
try {
|
|
296
|
-
return window.self !== window.top && window.name ===
|
|
296
|
+
return window.self !== window.top && window.name === me;
|
|
297
297
|
} catch (e) {
|
|
298
|
-
return window.name ===
|
|
298
|
+
return window.name === me;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function we() {
|
|
302
302
|
var n, t;
|
|
303
303
|
const e = typeof window == "undefined" ? void 0 : window;
|
|
304
304
|
return {
|
|
305
305
|
...B(),
|
|
306
|
-
pixelRatio:
|
|
306
|
+
pixelRatio: Te(),
|
|
307
307
|
screenWidth: (n = e == null ? void 0 : e.screen) == null ? void 0 : n.width,
|
|
308
308
|
screenHeight: (t = e == null ? void 0 : e.screen) == null ? void 0 : t.height,
|
|
309
309
|
windowWidth: e == null ? void 0 : e.innerWidth,
|
|
310
310
|
windowHeight: e == null ? void 0 : e.innerHeight
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
|
-
const
|
|
313
|
+
const S = We.init({
|
|
314
314
|
debug: !1
|
|
315
315
|
});
|
|
316
|
-
|
|
317
|
-
const
|
|
318
|
-
_.setDebug(e, n),
|
|
316
|
+
ln();
|
|
317
|
+
const hn = (e, n) => {
|
|
318
|
+
_.setDebug(e, n), S.setDebug(e, n);
|
|
319
319
|
};
|
|
320
|
-
let
|
|
321
|
-
const
|
|
322
|
-
|
|
320
|
+
let C;
|
|
321
|
+
const ir = (e) => {
|
|
322
|
+
C = e;
|
|
323
323
|
};
|
|
324
|
-
function
|
|
324
|
+
function Z(e) {
|
|
325
325
|
try {
|
|
326
|
-
|
|
326
|
+
C == null || C(e);
|
|
327
327
|
} catch (n) {
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
function w(e) {
|
|
331
|
-
return
|
|
331
|
+
return Oe() && Re(e);
|
|
332
332
|
}
|
|
333
|
-
const
|
|
334
|
-
function
|
|
333
|
+
const ee = /* @__PURE__ */ new Map();
|
|
334
|
+
function h(e, n, t = {}) {
|
|
335
335
|
const { since: r, once: i, transform: o } = t;
|
|
336
|
-
|
|
337
|
-
const s = w(r) ? _ :
|
|
338
|
-
let d =
|
|
339
|
-
d || (d = /* @__PURE__ */ new Map(),
|
|
336
|
+
E(e, n);
|
|
337
|
+
const s = w(r) ? _ : S;
|
|
338
|
+
let d = ee.get(e);
|
|
339
|
+
d || (d = /* @__PURE__ */ new Map(), ee.set(e, d));
|
|
340
340
|
const a = (y) => {
|
|
341
|
-
i &&
|
|
341
|
+
i && E(e, n), n(o ? o(y) : y);
|
|
342
342
|
};
|
|
343
|
-
return d.set(n, { handler: a, target: s }), s.on(e, a), () =>
|
|
343
|
+
return d.set(n, { handler: a, target: s }), s.on(e, a), () => E(e, n);
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
const t =
|
|
345
|
+
function E(e, n) {
|
|
346
|
+
const t = ee.get(e);
|
|
347
347
|
if (t)
|
|
348
348
|
for (const r of n ? [n] : [...t.keys()]) {
|
|
349
349
|
const i = t.get(r);
|
|
350
350
|
i && (i.target.off(e, i.handler), t.delete(r));
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function Le(e, n, t) {
|
|
354
354
|
const r = w(t);
|
|
355
|
-
return r ? _.register(e, async (i) =>
|
|
355
|
+
return r ? _.register(e, async (i) => F(await n(i))) : Be(e, n), () => (r ? _ : S).unregister(e);
|
|
356
356
|
}
|
|
357
|
-
function
|
|
358
|
-
(w(n) ? _ :
|
|
357
|
+
function pn(e, n) {
|
|
358
|
+
(w(n) ? _ : S).unregister(e);
|
|
359
359
|
}
|
|
360
|
-
function
|
|
361
|
-
return
|
|
360
|
+
function Be(e, n) {
|
|
361
|
+
return S.register(e, async (t) => {
|
|
362
362
|
try {
|
|
363
363
|
const r = await n(t);
|
|
364
|
-
return
|
|
364
|
+
return F(J(r));
|
|
365
365
|
} catch (r) {
|
|
366
|
-
const i =
|
|
366
|
+
const i = vn(e, r);
|
|
367
367
|
try {
|
|
368
|
-
return
|
|
368
|
+
return F(i);
|
|
369
369
|
} catch (o) {
|
|
370
370
|
return { code: i.code, msg: i.msg, result: {} };
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
}), () =>
|
|
373
|
+
}), () => S.unregister(e);
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
return { code:
|
|
375
|
+
function J(e) {
|
|
376
|
+
return { code: Pe, msg: "ok", result: e != null ? e : {} };
|
|
377
377
|
}
|
|
378
|
-
function
|
|
379
|
-
return O(e) &&
|
|
378
|
+
function bn(e) {
|
|
379
|
+
return O(e) && Ee(e.code);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
const r = f(n) ?
|
|
383
|
-
if (!
|
|
384
|
-
if (r.code !==
|
|
385
|
-
return
|
|
381
|
+
function mn(e, n, t) {
|
|
382
|
+
const r = f(n) ? ke(n, n) : n;
|
|
383
|
+
if (!bn(r)) throw v(e, re, m(r));
|
|
384
|
+
if (r.code !== Pe) throw v(e, r.code, r.msg || `code ${r.code}`);
|
|
385
|
+
return J(ne(e, t, r.result));
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function ne(e, n, t) {
|
|
388
388
|
try {
|
|
389
389
|
return n ? n(t) : t;
|
|
390
390
|
} catch (r) {
|
|
391
|
-
throw
|
|
391
|
+
throw ie(r) ? r : v(e, Ie, m(r));
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
return
|
|
394
|
+
function ie(e) {
|
|
395
|
+
return P(e) && f(e.errMsg) && Ee(e.errCode);
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function v(e, n, t) {
|
|
398
398
|
return { errMsg: `${e}:fail ${t}`, errCode: n };
|
|
399
399
|
}
|
|
400
|
-
function
|
|
401
|
-
return n instanceof
|
|
400
|
+
function wn(e, n) {
|
|
401
|
+
return n instanceof W ? v(e, n.kind === "native" ? Ge : z, n.message) : v(e, z, m(n));
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function vn(e, n) {
|
|
404
404
|
return {
|
|
405
|
-
code:
|
|
405
|
+
code: re,
|
|
406
406
|
msg: `${e}:fail ${m(n)}`,
|
|
407
|
-
result:
|
|
407
|
+
result: P(n) && "result" in n ? n.result : n
|
|
408
408
|
};
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function V(e, n) {
|
|
411
411
|
try {
|
|
412
412
|
e == null || e(n);
|
|
413
413
|
} catch (t) {
|
|
414
414
|
console.error("[mys-sdk] 回调执行错误", t);
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
function
|
|
418
|
-
return
|
|
417
|
+
function oe(e, n) {
|
|
418
|
+
return V(n == null ? void 0 : n.fail, e), V(n == null ? void 0 : n.complete, e), Promise.reject(e);
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function De(e, n, t) {
|
|
421
421
|
return n.then(
|
|
422
422
|
(r) => {
|
|
423
423
|
const i = r;
|
|
424
|
-
return
|
|
424
|
+
return V(t == null ? void 0 : t.success, i), V(t == null ? void 0 : t.complete, i), i;
|
|
425
425
|
},
|
|
426
|
-
(r) =>
|
|
426
|
+
(r) => oe(ie(r) ? r : v(e, z, m(r)), t)
|
|
427
427
|
);
|
|
428
428
|
}
|
|
429
429
|
function c(e, n, t) {
|
|
430
|
-
return
|
|
430
|
+
return oe(v(e, Ve, `parameter error: ${n}`), t);
|
|
431
431
|
}
|
|
432
|
-
function
|
|
433
|
-
return
|
|
432
|
+
function ue(e, n, t) {
|
|
433
|
+
return oe(v(e, Je, `unsupported: ${n}`), t);
|
|
434
434
|
}
|
|
435
|
-
function
|
|
435
|
+
function te(e, n, t, r) {
|
|
436
436
|
var o;
|
|
437
|
-
|
|
437
|
+
C && Z({ fnName: e, channel: "local", appVersion: (o = B()) == null ? void 0 : o.app_version, method: e, data: n });
|
|
438
438
|
let i;
|
|
439
439
|
try {
|
|
440
|
-
i = Promise.resolve(
|
|
440
|
+
i = Promise.resolve(J(t()));
|
|
441
441
|
} catch (s) {
|
|
442
|
-
i = Promise.reject(
|
|
442
|
+
i = Promise.reject(ie(s) ? s : v(e, re, m(s)));
|
|
443
443
|
}
|
|
444
|
-
return
|
|
444
|
+
return De(e, i, r);
|
|
445
445
|
}
|
|
446
446
|
function u(e, n = {}, t, r = {}) {
|
|
447
|
-
var
|
|
447
|
+
var de;
|
|
448
448
|
const { since: i, legacyOnly: o, jsbridge: s, transformResult: d, ...a } = r, y = o || w(i);
|
|
449
|
-
let
|
|
449
|
+
let A;
|
|
450
450
|
try {
|
|
451
|
-
const l =
|
|
452
|
-
|
|
451
|
+
const l = F(n);
|
|
452
|
+
A = O(l) ? l : {};
|
|
453
453
|
} catch (l) {
|
|
454
454
|
const R = l instanceof T || l instanceof TypeError ? l.message : "参数无法序列化";
|
|
455
455
|
return c(e, R, t);
|
|
456
456
|
}
|
|
457
|
-
const
|
|
457
|
+
const ce = (de = B()) == null ? void 0 : de.app_version;
|
|
458
458
|
let D;
|
|
459
459
|
try {
|
|
460
460
|
if (y) {
|
|
461
|
-
const l =
|
|
462
|
-
|
|
463
|
-
(R) =>
|
|
464
|
-
(R) => Promise.reject(
|
|
461
|
+
const l = ne(e, s == null ? void 0 : s.data, A);
|
|
462
|
+
C && Z({ fnName: e, channel: "jsbridge", appVersion: ce, since: i, method: e, data: l }), D = _.callAsync(e, l, a).then(
|
|
463
|
+
(R) => J(ne(e, s == null ? void 0 : s.result, R)),
|
|
464
|
+
(R) => Promise.reject(wn(e, R))
|
|
465
465
|
);
|
|
466
466
|
} else
|
|
467
|
-
|
|
467
|
+
C && Z({ fnName: e, channel: "mysJSBridge", appVersion: ce, since: i, method: e, data: A }), D = S.callAsync(e, A, a).then((l) => mn(e, l, d));
|
|
468
468
|
} catch (l) {
|
|
469
469
|
D = Promise.reject(l);
|
|
470
470
|
}
|
|
471
|
-
return
|
|
471
|
+
return De(e, D, t);
|
|
472
472
|
}
|
|
473
|
-
const
|
|
474
|
-
var
|
|
475
|
-
function
|
|
473
|
+
const or = u;
|
|
474
|
+
var je = /* @__PURE__ */ ((e) => (e[e.Short = 0] = "Short", e[e.Long = 1] = "Long", e))(je || {}), H = /* @__PURE__ */ ((e) => (e[e.RecentContacts = 1] = "RecentContacts", e[e.External = 2] = "External", e[e.Channel = 3] = "Channel", e))(H || {});
|
|
475
|
+
function Pn(e) {
|
|
476
476
|
var n;
|
|
477
477
|
return e.text ? u(
|
|
478
478
|
"showToast",
|
|
479
479
|
{
|
|
480
480
|
text: e.text,
|
|
481
|
-
duration: (n = e.duration) != null ? n :
|
|
481
|
+
duration: (n = e.duration) != null ? n : je.Short
|
|
482
482
|
},
|
|
483
483
|
e,
|
|
484
484
|
{
|
|
@@ -488,7 +488,7 @@ function wn(e) {
|
|
|
488
488
|
}
|
|
489
489
|
) : c("showToast", "text is required", e);
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function In(e = {}) {
|
|
492
492
|
var n, t;
|
|
493
493
|
return u(
|
|
494
494
|
"triggerVibrate",
|
|
@@ -505,29 +505,29 @@ function vn(e = {}) {
|
|
|
505
505
|
}
|
|
506
506
|
);
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function En(e) {
|
|
509
509
|
return u("stopVibrate", {}, e, { since: "4.4.0", queue: "serial" });
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function kn(e) {
|
|
512
512
|
return u("hideKeyboard", {}, e);
|
|
513
513
|
}
|
|
514
|
-
function
|
|
515
|
-
|
|
514
|
+
function Cn(e, n) {
|
|
515
|
+
h("keyboardHeightChange", e, {
|
|
516
516
|
since: "4.4.0",
|
|
517
517
|
once: n == null ? void 0 : n.once,
|
|
518
|
-
transform: (t) => t ? t /
|
|
518
|
+
transform: (t) => t ? t / Te() : 0
|
|
519
519
|
});
|
|
520
520
|
}
|
|
521
|
-
function
|
|
522
|
-
|
|
521
|
+
function Sn(e) {
|
|
522
|
+
E("keyboardHeightChange", e);
|
|
523
523
|
}
|
|
524
524
|
function An(e, n) {
|
|
525
|
-
|
|
525
|
+
h("onCommentPanelChange", e, { since: "4.4.0", once: n == null ? void 0 : n.once });
|
|
526
526
|
}
|
|
527
|
-
function
|
|
528
|
-
|
|
527
|
+
function qn(e) {
|
|
528
|
+
E("onCommentPanelChange", e);
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function $e(e, n) {
|
|
531
531
|
var i, o;
|
|
532
532
|
if (!((i = n.urls) != null && i.length))
|
|
533
533
|
return c(e, "urls is required", n);
|
|
@@ -546,13 +546,13 @@ function De(e, n) {
|
|
|
546
546
|
{ legacyOnly: !0 }
|
|
547
547
|
) : u("previewMedia", { type: r ? "image" : "video", urls: n.urls, current: t }, n);
|
|
548
548
|
}
|
|
549
|
-
function
|
|
550
|
-
return
|
|
549
|
+
function _n(e) {
|
|
550
|
+
return $e("previewImage", e);
|
|
551
551
|
}
|
|
552
|
-
function
|
|
553
|
-
return
|
|
552
|
+
function On(e) {
|
|
553
|
+
return $e("previewVideo", e);
|
|
554
554
|
}
|
|
555
|
-
function
|
|
555
|
+
function Rn(e = {}) {
|
|
556
556
|
var n, t, r, i, o;
|
|
557
557
|
return e.count !== void 0 && (!Number.isInteger(e.count) || e.count <= 0) ? c("chooseMedia", "可选择照片数量范围为1-9张", e) : u(
|
|
558
558
|
"chooseMedia",
|
|
@@ -567,17 +567,17 @@ function _n(e = {}) {
|
|
|
567
567
|
{ queue: "serial" }
|
|
568
568
|
);
|
|
569
569
|
}
|
|
570
|
-
let
|
|
571
|
-
function
|
|
570
|
+
let K = !1;
|
|
571
|
+
function Tn(e) {
|
|
572
572
|
var t;
|
|
573
573
|
if (!Array.isArray(e.files) || e.files.length === 0)
|
|
574
574
|
return c("uploadFiles", "files is required", e);
|
|
575
575
|
if (e.files.some((r) => !r))
|
|
576
576
|
return c("uploadFiles", "files[] is required", e);
|
|
577
|
-
if (
|
|
577
|
+
if (K)
|
|
578
578
|
return c("uploadFiles", "another uploadFiles request is in progress", e);
|
|
579
|
-
|
|
580
|
-
const n = e.onProgress ?
|
|
579
|
+
K = !0;
|
|
580
|
+
const n = e.onProgress ? h("uploadFilesProgress", e.onProgress) : void 0;
|
|
581
581
|
return u(
|
|
582
582
|
"uploadFiles",
|
|
583
583
|
{
|
|
@@ -587,46 +587,46 @@ function On(e) {
|
|
|
587
587
|
e,
|
|
588
588
|
{ queue: "serial" }
|
|
589
589
|
).finally(() => {
|
|
590
|
-
|
|
590
|
+
K = !1, n == null || n();
|
|
591
591
|
});
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function Mn(e) {
|
|
594
594
|
const n = O(e) ? e : {};
|
|
595
595
|
if (n.status === "success" || n.result === "success") return;
|
|
596
|
-
throw { errMsg: `saveImageToPhotosAlbum:fail ${f(n.reason) && n.reason ? n.reason : "unknown reason"}`, errCode:
|
|
596
|
+
throw { errMsg: `saveImageToPhotosAlbum:fail ${f(n.reason) && n.reason ? n.reason : "unknown reason"}`, errCode: Ie, errDetail: e };
|
|
597
597
|
}
|
|
598
|
-
function
|
|
599
|
-
return
|
|
598
|
+
function Ln(e) {
|
|
599
|
+
return Xe(e == null ? void 0 : e.filePath) ? u("saveMediaToPhotosAlbum", { type: "image", file: e.filePath }, e, {
|
|
600
600
|
legacyOnly: !0,
|
|
601
|
-
jsbridge: { result:
|
|
601
|
+
jsbridge: { result: Mn }
|
|
602
602
|
}) : c("saveImageToPhotosAlbum", "filePath must be base64 data (data URL or plain base64)", e);
|
|
603
603
|
}
|
|
604
|
-
let
|
|
605
|
-
function
|
|
606
|
-
|
|
604
|
+
let b;
|
|
605
|
+
function Bn(e) {
|
|
606
|
+
b == null || b.release();
|
|
607
607
|
const { onEnd: n, onProgress: t } = e != null ? e : {};
|
|
608
608
|
let r, i;
|
|
609
609
|
const o = {
|
|
610
610
|
stopProgress: () => r == null ? void 0 : r(),
|
|
611
611
|
release: () => {
|
|
612
|
-
r == null || r(), i == null || i(),
|
|
612
|
+
r == null || r(), i == null || i(), b === o && (b = void 0);
|
|
613
613
|
}
|
|
614
614
|
};
|
|
615
|
-
return r = t ?
|
|
615
|
+
return r = t ? h("onRecordAudioProgress", t) : void 0, i = h("onRecordAudioEnd", (s) => {
|
|
616
616
|
o.release(), n == null || n({ ...s, duration: s.duration / 1e3, size: s.size / 1024 });
|
|
617
|
-
}),
|
|
617
|
+
}), b = o, o;
|
|
618
618
|
}
|
|
619
|
-
function
|
|
619
|
+
function Dn(e) {
|
|
620
620
|
const n = e == null ? void 0 : e.maxDuration;
|
|
621
621
|
if (n !== void 0 && (!Number.isFinite(n) || n <= 0))
|
|
622
622
|
return c("startRecordAudio", "maxDuration must be a number greater than 0", e);
|
|
623
|
-
const { release: t } =
|
|
623
|
+
const { release: t } = Bn(e);
|
|
624
624
|
return u("startRecordAudio", { maxDuration: n }, e, { queue: "serial" }).catch((r) => {
|
|
625
625
|
throw t(), r;
|
|
626
626
|
});
|
|
627
627
|
}
|
|
628
|
-
function
|
|
629
|
-
const n =
|
|
628
|
+
function jn(e) {
|
|
629
|
+
const n = b;
|
|
630
630
|
return u("stopRecordAudio", {}, e).then(
|
|
631
631
|
(t) => (n == null || n.stopProgress(), t),
|
|
632
632
|
(t) => {
|
|
@@ -634,130 +634,130 @@ function Bn(e) {
|
|
|
634
634
|
}
|
|
635
635
|
);
|
|
636
636
|
}
|
|
637
|
-
function
|
|
638
|
-
return
|
|
637
|
+
function $n(e) {
|
|
638
|
+
return b == null || b.release(), u("cancelRecordAudio", {}, e);
|
|
639
639
|
}
|
|
640
|
-
function
|
|
641
|
-
return w("4.4.0") ?
|
|
642
|
-
transformResult: (n) => ({ ...
|
|
640
|
+
function Nn(e) {
|
|
641
|
+
return w("4.4.0") ? te("getSystemInfo", {}, we, e) : u("getSystemInfo", {}, e, {
|
|
642
|
+
transformResult: (n) => ({ ...we(), ...O(n) ? n : {} })
|
|
643
643
|
});
|
|
644
644
|
}
|
|
645
|
-
function
|
|
645
|
+
function xn(e) {
|
|
646
646
|
return e.data === void 0 ? c("setClipboardData", "data is required", e) : u("setClipboardData", { data: e.data }, e);
|
|
647
647
|
}
|
|
648
|
-
function
|
|
648
|
+
function Un(e) {
|
|
649
649
|
return u("getClipboardData", {}, e);
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function Hn(e) {
|
|
652
652
|
return { permission: "notification", result: O(e) && e.isOpen === !0 ? "granted" : "denied" };
|
|
653
653
|
}
|
|
654
|
-
function
|
|
655
|
-
return e.permission ? w("4.4.0") ? e.permission !== "notification" ?
|
|
654
|
+
function Fn(e) {
|
|
655
|
+
return e.permission ? w("4.4.0") ? e.permission !== "notification" ? ue("checkPermission", `permission ${e.permission} requires app >= 4.4.0`, e) : u("isNotificationEnabled", {}, e, {
|
|
656
656
|
legacyOnly: !0,
|
|
657
|
-
jsbridge: { result:
|
|
657
|
+
jsbridge: { result: Hn }
|
|
658
658
|
}) : u("checkPermission", { permission: e.permission }, e) : c("checkPermission", "permission is required", e);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
661
|
-
return e.permission ? w("4.4.0") ? e.permission !== "notification" ?
|
|
660
|
+
function Wn(e) {
|
|
661
|
+
return e.permission ? w("4.4.0") ? e.permission !== "notification" ? ue("openPhoneSetting", `permission ${e.permission} requires app >= 4.4.0`, e) : u("gotoSetPhoneNotify", {}, e, { legacyOnly: !0 }) : u("openPhoneSetting", { permission: e.permission }, e, { queue: "serial" }) : c("openPhoneSetting", "permission is required", e);
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function Gn(e = {}) {
|
|
664
664
|
return u("openApp", { url: e.url, packageNames: e.packageNames }, e, { since: "4.4.0", queue: "serial" });
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function Vn(e) {
|
|
667
667
|
return typeof (e == null ? void 0 : e.enable) != "boolean" ? c("swipeBack", "enable must be a boolean", e) : u("swipeBack", { enable: e.enable }, e);
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function Jn(e) {
|
|
670
670
|
return e.nameType === void 0 ? c("showPageName", "nameType is required", e) : u("showPageName", { nameType: e.nameType }, e, { since: "4.4.0" });
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function Kn(e) {
|
|
673
673
|
return u("H5Loaded", {}, e, { since: "4.4.0" });
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function zn(e) {
|
|
676
676
|
return u("getBeforeInfo", {}, e, { since: "4.4.0" });
|
|
677
677
|
}
|
|
678
|
-
function
|
|
678
|
+
function Yn(e = {}) {
|
|
679
679
|
return u("setH5BeforeInfo", e, e, { since: "4.4.0" });
|
|
680
680
|
}
|
|
681
|
-
function zn(e, n) {
|
|
682
|
-
b("h5PageShow", e, { since: "4.4.0", once: n == null ? void 0 : n.once });
|
|
683
|
-
}
|
|
684
|
-
function Yn(e) {
|
|
685
|
-
v("h5PageShow", e);
|
|
686
|
-
}
|
|
687
681
|
function Xn(e, n) {
|
|
688
|
-
|
|
682
|
+
h("h5PageShow", e, { since: "4.4.0", once: n == null ? void 0 : n.once });
|
|
689
683
|
}
|
|
690
684
|
function Qn(e) {
|
|
691
|
-
|
|
685
|
+
E("h5PageShow", e);
|
|
692
686
|
}
|
|
693
687
|
function Zn(e, n) {
|
|
694
|
-
|
|
688
|
+
h("h5PageVisible", e, { since: "4.4.0", once: n == null ? void 0 : n.once });
|
|
695
689
|
}
|
|
696
690
|
function et(e) {
|
|
697
|
-
|
|
691
|
+
E("h5PageVisible", e);
|
|
698
692
|
}
|
|
699
|
-
|
|
693
|
+
function nt(e, n) {
|
|
694
|
+
h("h5PageInvisible", e, { since: "4.4.0", once: n == null ? void 0 : n.once });
|
|
695
|
+
}
|
|
696
|
+
function tt(e) {
|
|
697
|
+
E("h5PageInvisible", e);
|
|
698
|
+
}
|
|
699
|
+
const rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
700
700
|
__proto__: null,
|
|
701
|
-
cancelRecordAudio:
|
|
702
|
-
checkPermission:
|
|
703
|
-
chooseMedia:
|
|
704
|
-
getBeforeInfo:
|
|
705
|
-
getClipboardData:
|
|
706
|
-
getSystemInfo:
|
|
707
|
-
h5Loaded:
|
|
708
|
-
hideKeyboard:
|
|
709
|
-
offCommentPanelChange:
|
|
710
|
-
offKeyboardHeightChange:
|
|
711
|
-
offPageInvisible:
|
|
712
|
-
offPageShow:
|
|
713
|
-
offPageVisible:
|
|
701
|
+
cancelRecordAudio: $n,
|
|
702
|
+
checkPermission: Fn,
|
|
703
|
+
chooseMedia: Rn,
|
|
704
|
+
getBeforeInfo: zn,
|
|
705
|
+
getClipboardData: Un,
|
|
706
|
+
getSystemInfo: Nn,
|
|
707
|
+
h5Loaded: Kn,
|
|
708
|
+
hideKeyboard: kn,
|
|
709
|
+
offCommentPanelChange: qn,
|
|
710
|
+
offKeyboardHeightChange: Sn,
|
|
711
|
+
offPageInvisible: tt,
|
|
712
|
+
offPageShow: Qn,
|
|
713
|
+
offPageVisible: et,
|
|
714
714
|
onCommentPanelChange: An,
|
|
715
|
-
onKeyboardHeightChange:
|
|
716
|
-
onPageInvisible:
|
|
717
|
-
onPageShow:
|
|
718
|
-
onPageVisible:
|
|
719
|
-
openApp:
|
|
720
|
-
openPhoneSetting:
|
|
721
|
-
previewImage:
|
|
722
|
-
previewVideo:
|
|
723
|
-
saveImageToPhotosAlbum:
|
|
724
|
-
setBeforeInfo:
|
|
725
|
-
setClipboardData:
|
|
726
|
-
showPageName:
|
|
727
|
-
showToast:
|
|
728
|
-
startRecordAudio:
|
|
729
|
-
stopRecordAudio:
|
|
730
|
-
stopVibrate:
|
|
731
|
-
swipeBack:
|
|
732
|
-
triggerVibrate:
|
|
733
|
-
uploadFiles:
|
|
715
|
+
onKeyboardHeightChange: Cn,
|
|
716
|
+
onPageInvisible: nt,
|
|
717
|
+
onPageShow: Xn,
|
|
718
|
+
onPageVisible: Zn,
|
|
719
|
+
openApp: Gn,
|
|
720
|
+
openPhoneSetting: Wn,
|
|
721
|
+
previewImage: _n,
|
|
722
|
+
previewVideo: On,
|
|
723
|
+
saveImageToPhotosAlbum: Ln,
|
|
724
|
+
setBeforeInfo: Yn,
|
|
725
|
+
setClipboardData: xn,
|
|
726
|
+
showPageName: Jn,
|
|
727
|
+
showToast: Pn,
|
|
728
|
+
startRecordAudio: Dn,
|
|
729
|
+
stopRecordAudio: jn,
|
|
730
|
+
stopVibrate: En,
|
|
731
|
+
swipeBack: Vn,
|
|
732
|
+
triggerVibrate: In,
|
|
733
|
+
uploadFiles: Tn
|
|
734
734
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
735
|
-
function
|
|
735
|
+
function it(e) {
|
|
736
736
|
return u("login", {}, e, { since: "4.4.0", queue: "serial" });
|
|
737
737
|
}
|
|
738
|
-
function
|
|
738
|
+
function ot(e) {
|
|
739
739
|
return u("getToken", {}, e, {
|
|
740
740
|
since: "4.4.0",
|
|
741
741
|
// 旧通道可能直接返回 token 字符串,统一成对象
|
|
742
742
|
jsbridge: { result: (n) => f(n) ? { token: n } : n }
|
|
743
743
|
});
|
|
744
744
|
}
|
|
745
|
-
function
|
|
745
|
+
function ut(e) {
|
|
746
746
|
return u("getCurrentCircleInfo", {}, e, { since: "4.4.0" });
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function st(e) {
|
|
749
749
|
var r;
|
|
750
750
|
if (!e.title)
|
|
751
751
|
return c("shareWebCard", "title is required", e);
|
|
752
752
|
if (!e.daokeUrl)
|
|
753
753
|
return c("shareWebCard", "daokeUrl is required", e);
|
|
754
|
-
const { activityDetail: n } = e, t =
|
|
754
|
+
const { activityDetail: n } = e, t = ct(e);
|
|
755
755
|
return u(
|
|
756
756
|
"shareWebCard",
|
|
757
757
|
{
|
|
758
758
|
...e,
|
|
759
|
-
shareTypes: (r = e.shareTypes) != null ? r : [
|
|
760
|
-
activityDetail:
|
|
759
|
+
shareTypes: (r = e.shareTypes) != null ? r : [H.RecentContacts, H.External, H.Channel],
|
|
760
|
+
activityDetail: P(n) ? JSON.stringify(n) : n
|
|
761
761
|
},
|
|
762
762
|
e,
|
|
763
763
|
{ since: "4.4.0", queue: "serial" }
|
|
@@ -766,24 +766,24 @@ function ot(e) {
|
|
|
766
766
|
});
|
|
767
767
|
}
|
|
768
768
|
let j;
|
|
769
|
-
function
|
|
769
|
+
function ct(e) {
|
|
770
770
|
j == null || j();
|
|
771
771
|
const { onShared: n, getSharePictureUrl: t, isSharePic: r } = e, i = r ? t : void 0;
|
|
772
772
|
let o, s;
|
|
773
773
|
const d = () => {
|
|
774
774
|
o == null || o(), s == null || s();
|
|
775
775
|
};
|
|
776
|
-
return (n || i) && (o =
|
|
776
|
+
return (n || i) && (o = h("onShared", (a) => {
|
|
777
777
|
d(), n == null || n(a);
|
|
778
|
-
}, { since: "4.4.0" })), i && (s =
|
|
778
|
+
}, { since: "4.4.0" })), i && (s = Le("getSharePictureUrl", i, "4.4.0")), j = d, d;
|
|
779
779
|
}
|
|
780
|
-
function
|
|
780
|
+
function dt(e) {
|
|
781
781
|
return !e.url || !/^https?:\/\//i.test(e.url) ? c("shareImage", "url must be a valid http(s) url", e) : u("shareImage", { url: e.url }, e, { queue: "serial" });
|
|
782
782
|
}
|
|
783
|
-
function
|
|
783
|
+
function at(e) {
|
|
784
784
|
return u("openAddCustomEmoji", {}, e, { since: "4.4.0", queue: "serial" });
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function lt(e) {
|
|
787
787
|
return e.serverId ? e.dynamicId ? u(
|
|
788
788
|
"openCommentPanel",
|
|
789
789
|
{
|
|
@@ -796,87 +796,112 @@ function dt(e) {
|
|
|
796
796
|
{ since: "4.4.0", queue: "serial" }
|
|
797
797
|
) : c("openCommentPanel", "dynamicId is required", e) : c("openCommentPanel", "serverId is required", e);
|
|
798
798
|
}
|
|
799
|
-
function
|
|
799
|
+
function ft(e) {
|
|
800
800
|
return u("showLongVipDesDialog", {}, e, { since: "4.4.0", queue: "serial" });
|
|
801
801
|
}
|
|
802
|
-
function
|
|
802
|
+
function gt(e) {
|
|
803
803
|
return e.index === void 0 ? c("voteAction", "index is required", e) : u("voteAction", e, e, { since: "4.4.0", queue: "serial" });
|
|
804
804
|
}
|
|
805
|
-
function
|
|
806
|
-
return Array.isArray(e.selectedUserIds) ? w("4.4.0") ?
|
|
805
|
+
function yt(e) {
|
|
806
|
+
return Array.isArray(e.selectedUserIds) ? w("4.4.0") ? ht(e) : u("openFriendsList", { selectedUserIds: e.selectedUserIds }, e, {
|
|
807
807
|
queue: "serial",
|
|
808
|
-
transformResult:
|
|
808
|
+
transformResult: Ne
|
|
809
809
|
}) : c("openFriendsList", "selectedUserIds is required", e);
|
|
810
810
|
}
|
|
811
|
-
function
|
|
812
|
-
const n =
|
|
811
|
+
function Ne(e) {
|
|
812
|
+
const n = P(e) ? e.selectedList : void 0;
|
|
813
813
|
return { selectedList: Array.isArray(n) ? n : [] };
|
|
814
814
|
}
|
|
815
|
-
function
|
|
815
|
+
function ht(e) {
|
|
816
816
|
let n;
|
|
817
|
-
const t =
|
|
817
|
+
const t = h("submitFriendsList", (r) => {
|
|
818
818
|
n = r;
|
|
819
819
|
}, { since: "4.4.0" });
|
|
820
820
|
return u("openFriendsList", { selectedUserIds: e.selectedUserIds }, e, {
|
|
821
821
|
legacyOnly: !0,
|
|
822
|
-
jsbridge: { result: () =>
|
|
822
|
+
jsbridge: { result: () => Ne(n) }
|
|
823
823
|
}).finally(() => t());
|
|
824
824
|
}
|
|
825
|
-
function
|
|
825
|
+
function pt(e) {
|
|
826
826
|
return e.gameName ? e.serverId ? u("pointsMallBindGame", e, e, { since: "4.4.0", queue: "serial" }) : c("toBindGameRole", "serverId is required", e) : c("toBindGameRole", "gameName is required", e);
|
|
827
827
|
}
|
|
828
|
-
function ht(e) {
|
|
829
|
-
return u("bindGameRoleSuccess", {}, e, { since: "4.4.0" });
|
|
830
|
-
}
|
|
831
828
|
function bt(e) {
|
|
832
|
-
return
|
|
833
|
-
}
|
|
834
|
-
function pt(e, n) {
|
|
835
|
-
b("onAdFinished", e, { since: "4.4.0", once: n == null ? void 0 : n.once });
|
|
829
|
+
return u("bindGameRoleSuccess", {}, e, { since: "4.4.0" });
|
|
836
830
|
}
|
|
837
831
|
function mt(e) {
|
|
838
|
-
|
|
832
|
+
return e.type === void 0 ? c("showAd", "type is required", e) : (wt(e), u("showAdVideo", { type: e.type, params: e.params }, e, {
|
|
833
|
+
since: "4.4.0",
|
|
834
|
+
queue: "serial"
|
|
835
|
+
}));
|
|
839
836
|
}
|
|
837
|
+
const $ = /* @__PURE__ */ new Map();
|
|
840
838
|
function wt(e) {
|
|
841
|
-
|
|
839
|
+
var s, d;
|
|
840
|
+
const { onFinished: n } = e;
|
|
841
|
+
if (!n) return;
|
|
842
|
+
const t = (s = e.params) == null ? void 0 : s.module, r = t === void 0 ? void 0 : String(t);
|
|
843
|
+
(d = $.get(r)) == null || d();
|
|
844
|
+
let i;
|
|
845
|
+
const o = () => {
|
|
846
|
+
i == null || i(), $.get(r) === o && $.delete(r);
|
|
847
|
+
};
|
|
848
|
+
i = h("onAdFinished", (a) => {
|
|
849
|
+
r !== void 0 && String(a == null ? void 0 : a.module) !== r || (o(), n(a));
|
|
850
|
+
}, { since: "4.4.0" }), $.set(r, o);
|
|
842
851
|
}
|
|
843
852
|
function vt(e) {
|
|
844
|
-
return e.
|
|
853
|
+
return e.type ? u("updateData", { type: e.type, params: e.params }, e, { since: "4.4.0" }) : c("updateData", "type is required", e);
|
|
854
|
+
}
|
|
855
|
+
function Pt(e) {
|
|
856
|
+
if (!e.user_id)
|
|
857
|
+
return c("openGiftBag", "user_id is required", e);
|
|
858
|
+
if (!e.server_id)
|
|
859
|
+
return c("openGiftBag", "server_id is required", e);
|
|
860
|
+
const n = It(e);
|
|
861
|
+
return u(
|
|
845
862
|
"openGiftBag",
|
|
846
863
|
{ user_id: e.user_id, openBag: e.openBag, server_id: e.server_id },
|
|
847
864
|
e,
|
|
848
865
|
{ since: "4.4.0", queue: "serial" }
|
|
849
|
-
)
|
|
866
|
+
).catch((t) => {
|
|
867
|
+
throw n(), t;
|
|
868
|
+
});
|
|
850
869
|
}
|
|
851
|
-
|
|
852
|
-
|
|
870
|
+
let N;
|
|
871
|
+
function It(e) {
|
|
872
|
+
N == null || N();
|
|
873
|
+
const { onSent: n } = e;
|
|
874
|
+
let t;
|
|
875
|
+
const r = () => t == null ? void 0 : t();
|
|
876
|
+
return n && (t = h("openGiftBag", (i) => n(i), { since: "4.4.0" })), N = r, r;
|
|
877
|
+
}
|
|
878
|
+
function Et(e) {
|
|
879
|
+
Le("getMemberActivate", e, "4.4.0");
|
|
853
880
|
}
|
|
854
|
-
function
|
|
855
|
-
|
|
881
|
+
function kt() {
|
|
882
|
+
pn("getMemberActivate", "4.4.0");
|
|
856
883
|
}
|
|
857
|
-
const
|
|
884
|
+
const Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
858
885
|
__proto__: null,
|
|
859
|
-
bindGameRoleSuccess:
|
|
860
|
-
getCurrentCircleInfo:
|
|
861
|
-
getToken:
|
|
862
|
-
login:
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
}, Symbol.toStringTag, { value: "Module" })), Ct = "community-open-app", At = "https://app.docoi.cc/open-app", kt = /quark|qqbrowser|ucbrowser/, qt = 2e3;
|
|
879
|
-
function St(e, n) {
|
|
886
|
+
bindGameRoleSuccess: bt,
|
|
887
|
+
getCurrentCircleInfo: ut,
|
|
888
|
+
getToken: ot,
|
|
889
|
+
login: it,
|
|
890
|
+
offMemberActivate: kt,
|
|
891
|
+
onMemberActivate: Et,
|
|
892
|
+
openAddCustomEmoji: at,
|
|
893
|
+
openCommentPanel: lt,
|
|
894
|
+
openFriendsList: yt,
|
|
895
|
+
openGiftBag: Pt,
|
|
896
|
+
shareImage: dt,
|
|
897
|
+
shareWebCard: st,
|
|
898
|
+
showAd: mt,
|
|
899
|
+
showLongVipDesDialog: ft,
|
|
900
|
+
toBindGameRole: pt,
|
|
901
|
+
updateData: vt,
|
|
902
|
+
voteAction: gt
|
|
903
|
+
}, Symbol.toStringTag, { value: "Module" })), St = "community-open-app", At = "https://app.docoi.cc/open-app", qt = /quark|qqbrowser|ucbrowser/, _t = 2e3;
|
|
904
|
+
function Ot(e, n) {
|
|
880
905
|
if (window.location.href = e, !n) return;
|
|
881
906
|
let t = !1;
|
|
882
907
|
const r = () => {
|
|
@@ -886,22 +911,22 @@ function St(e, n) {
|
|
|
886
911
|
};
|
|
887
912
|
window.addEventListener("pagehide", r), document.addEventListener("visibilitychange", i), setTimeout(() => {
|
|
888
913
|
t || (r(), n());
|
|
889
|
-
},
|
|
914
|
+
}, _t);
|
|
890
915
|
}
|
|
891
|
-
function
|
|
892
|
-
if (
|
|
893
|
-
window.parent.postMessage({ type:
|
|
916
|
+
function Rt(e, n) {
|
|
917
|
+
if (yn()) {
|
|
918
|
+
window.parent.postMessage({ type: St, params: e.query }, "*");
|
|
894
919
|
return;
|
|
895
920
|
}
|
|
896
921
|
const t = navigator.userAgent.toLowerCase(), r = t.includes("micromessenger") || t.includes("qq/");
|
|
897
|
-
if (
|
|
922
|
+
if (Me() === "ios" && !r && !qt.test(t)) {
|
|
898
923
|
const i = e.url.includes("?") ? e.url.slice(e.url.indexOf("?")) : "";
|
|
899
924
|
window.location.href = `${At}${i}`;
|
|
900
925
|
return;
|
|
901
926
|
}
|
|
902
|
-
|
|
927
|
+
Ot(e.url, n);
|
|
903
928
|
}
|
|
904
|
-
const
|
|
929
|
+
const ve = "daoke://", xe = {
|
|
905
930
|
joinCirclePage: {
|
|
906
931
|
type: 1,
|
|
907
932
|
name: "查询圈子并加入",
|
|
@@ -925,6 +950,7 @@ const me = "daoke://", $e = {
|
|
|
925
950
|
fields: {
|
|
926
951
|
serverId: { key: "cid", required: !0 },
|
|
927
952
|
action: { key: "actionType", enum: { publish: "1" } },
|
|
953
|
+
publishType: { key: "publishType" },
|
|
928
954
|
relationType: {
|
|
929
955
|
key: "relationType",
|
|
930
956
|
enum: { apprentice: "1", graduate: "2", intimacyShare: "3", takeApprentice: "4" }
|
|
@@ -1035,8 +1061,18 @@ const me = "daoke://", $e = {
|
|
|
1035
1061
|
serverId: { key: "serverId" }
|
|
1036
1062
|
}
|
|
1037
1063
|
},
|
|
1038
|
-
addCustomEmojiPage: { type: 34, name: "添加自定义表情", since: "4.4.0", fields: {} }
|
|
1039
|
-
|
|
1064
|
+
addCustomEmojiPage: { type: 34, name: "添加自定义表情", since: "4.4.0", fields: {} },
|
|
1065
|
+
dynamicPublishPage: {
|
|
1066
|
+
type: 35,
|
|
1067
|
+
name: "动态发布",
|
|
1068
|
+
since: "4.4.0",
|
|
1069
|
+
fields: {
|
|
1070
|
+
serverId: { key: "serverId", required: !0 },
|
|
1071
|
+
channelId: { key: "channelId" },
|
|
1072
|
+
publishType: { key: "publishType" }
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
}, Tt = {
|
|
1040
1076
|
type: 18,
|
|
1041
1077
|
name: "底部 tab",
|
|
1042
1078
|
since: "3.7.0",
|
|
@@ -1046,7 +1082,7 @@ const me = "daoke://", $e = {
|
|
|
1046
1082
|
subTab: { key: "subTab", enum: { friends: "1_0", square: "1_1", comic: "1_2" } },
|
|
1047
1083
|
fromMbtiShare: { key: "form_mbti_share", bool: !0 }
|
|
1048
1084
|
}
|
|
1049
|
-
},
|
|
1085
|
+
}, Mt = {
|
|
1050
1086
|
type: 5,
|
|
1051
1087
|
name: "Webview",
|
|
1052
1088
|
fields: {
|
|
@@ -1054,125 +1090,126 @@ const me = "daoke://", $e = {
|
|
|
1054
1090
|
type: { key: "h5Type", required: !0, enum: { normal: "1", mini: "2", dynamic: "3", immersive: "4" } },
|
|
1055
1091
|
isUpdateApp: { key: "isUpdateApp", bool: !0 }
|
|
1056
1092
|
}
|
|
1057
|
-
},
|
|
1093
|
+
}, Lt = {
|
|
1058
1094
|
type: 23,
|
|
1059
1095
|
name: "纯透明 H5",
|
|
1060
1096
|
since: "3.8.0",
|
|
1061
1097
|
fields: { url: { key: "url", required: !0 } }
|
|
1062
|
-
},
|
|
1063
|
-
|
|
1064
|
-
tab:
|
|
1065
|
-
webview:
|
|
1066
|
-
transparentWebview:
|
|
1067
|
-
},
|
|
1068
|
-
Object.keys(
|
|
1098
|
+
}, q = {
|
|
1099
|
+
...xe,
|
|
1100
|
+
tab: Tt,
|
|
1101
|
+
webview: Mt,
|
|
1102
|
+
transparentWebview: Lt
|
|
1103
|
+
}, Bt = Object.fromEntries(
|
|
1104
|
+
Object.keys(q).map((e) => [String(q[e].type), e])
|
|
1069
1105
|
);
|
|
1070
|
-
function
|
|
1071
|
-
const n =
|
|
1072
|
-
return n ? { key: n, route:
|
|
1106
|
+
function Dt(e) {
|
|
1107
|
+
const n = Bt[e];
|
|
1108
|
+
return n ? { key: n, route: q[n] } : void 0;
|
|
1073
1109
|
}
|
|
1074
|
-
const
|
|
1075
|
-
class
|
|
1110
|
+
const Ue = "daoke://page";
|
|
1111
|
+
class p extends Error {
|
|
1076
1112
|
}
|
|
1077
|
-
function
|
|
1113
|
+
function x(e, n = {}) {
|
|
1078
1114
|
const t = { type: String(e.type) };
|
|
1079
1115
|
for (const [r, i] of Object.entries(e.fields)) {
|
|
1080
1116
|
const o = n[r];
|
|
1081
1117
|
if (o == null || o === "") {
|
|
1082
|
-
if (i.required) throw new
|
|
1118
|
+
if (i.required) throw new p(`${r} is required`);
|
|
1083
1119
|
continue;
|
|
1084
1120
|
}
|
|
1085
1121
|
if (i.enum) {
|
|
1086
1122
|
const s = i.enum[String(o)];
|
|
1087
|
-
if (s === void 0) throw new
|
|
1123
|
+
if (s === void 0) throw new p(`${r} must be one of ${Object.keys(i.enum).join(" / ")}`);
|
|
1088
1124
|
t[i.key] = s;
|
|
1089
1125
|
} else if (i.bool)
|
|
1090
1126
|
t[i.key] = o ? "true" : "false";
|
|
1091
1127
|
else {
|
|
1092
|
-
if (
|
|
1093
|
-
throw new
|
|
1128
|
+
if (P(o))
|
|
1129
|
+
throw new p(`${r} must be a string or number`);
|
|
1094
1130
|
t[i.key] = String(o);
|
|
1095
1131
|
}
|
|
1096
1132
|
}
|
|
1097
1133
|
return t;
|
|
1098
1134
|
}
|
|
1099
|
-
function
|
|
1135
|
+
function U(e) {
|
|
1100
1136
|
const n = Object.entries(e).map(([t, r]) => `${encodeURIComponent(t)}=${encodeURIComponent(r)}`).join("&");
|
|
1101
|
-
return { url: `${
|
|
1137
|
+
return { url: `${Ue}?${n}`, query: e };
|
|
1102
1138
|
}
|
|
1103
|
-
function
|
|
1104
|
-
if (!f(e) || !e.startsWith(
|
|
1139
|
+
function He(e) {
|
|
1140
|
+
if (!f(e) || !e.startsWith(Ue)) return null;
|
|
1105
1141
|
const n = e.indexOf("?");
|
|
1106
1142
|
if (n < 0) return null;
|
|
1107
1143
|
const t = {};
|
|
1108
1144
|
for (const r of e.slice(n + 1).split("&")) {
|
|
1109
1145
|
if (!r) continue;
|
|
1110
|
-
const i = r.indexOf("="), o =
|
|
1111
|
-
o && !(o in t) && (t[o] = i < 0 ? "" :
|
|
1146
|
+
const i = r.indexOf("="), o = ae(i < 0 ? r : r.slice(0, i));
|
|
1147
|
+
o && !(o in t) && (t[o] = i < 0 ? "" : ae(r.slice(i + 1)));
|
|
1112
1148
|
}
|
|
1113
1149
|
return t.type && /^\d+$/.test(t.type) ? t : null;
|
|
1114
1150
|
}
|
|
1115
|
-
function
|
|
1151
|
+
function jt(e) {
|
|
1116
1152
|
return "type" in e && !("url" in e);
|
|
1117
1153
|
}
|
|
1118
|
-
function
|
|
1119
|
-
if (!
|
|
1154
|
+
function $t(e) {
|
|
1155
|
+
if (!P(e == null ? void 0 : e.params)) throw new p("params is required");
|
|
1120
1156
|
switch (e.api) {
|
|
1121
1157
|
case "switchTab":
|
|
1122
|
-
return
|
|
1158
|
+
return U(x(q.tab, { ...e.params.params, tab: e.params.tab }));
|
|
1123
1159
|
case "openWebview": {
|
|
1124
1160
|
const { url: n, type: t = "normal", params: r } = e.params;
|
|
1125
|
-
if (!n || !f(n)) throw new
|
|
1126
|
-
if (t !== "transparent") return
|
|
1127
|
-
if (!n.startsWith("https://")) throw new
|
|
1128
|
-
if (r && Object.keys(r).length) throw new
|
|
1129
|
-
return
|
|
1161
|
+
if (!n || !f(n)) throw new p("url is required");
|
|
1162
|
+
if (t !== "transparent") return U(x(q.webview, { ...r, url: n, type: t }));
|
|
1163
|
+
if (!n.startsWith("https://")) throw new p("transparent webview url must be https");
|
|
1164
|
+
if (r && Object.keys(r).length) throw new p("transparent webview does not support params");
|
|
1165
|
+
return U(x(q.transparentWebview, { url: n }));
|
|
1130
1166
|
}
|
|
1131
1167
|
case "navigateTo": {
|
|
1132
|
-
if (
|
|
1133
|
-
const t =
|
|
1134
|
-
if (!t) throw new
|
|
1135
|
-
return
|
|
1168
|
+
if (jt(e.params)) {
|
|
1169
|
+
const t = xe[e.params.type];
|
|
1170
|
+
if (!t) throw new p(`unknown page type: ${String(e.params.type)}`);
|
|
1171
|
+
return U(x(t, e.params.params));
|
|
1136
1172
|
}
|
|
1137
|
-
const n =
|
|
1138
|
-
if (!n) throw new
|
|
1173
|
+
const n = He(e.params.url);
|
|
1174
|
+
if (!n) throw new p("url or type is required, url must be a daoke://page?type= link");
|
|
1139
1175
|
return { url: e.params.url, query: n };
|
|
1140
1176
|
}
|
|
1141
1177
|
default:
|
|
1142
|
-
throw new
|
|
1178
|
+
throw new p("unknown navigation api");
|
|
1143
1179
|
}
|
|
1144
1180
|
}
|
|
1145
|
-
const L = "4.4.0",
|
|
1181
|
+
const L = "4.4.0", Nt = 11, xt = {
|
|
1182
|
+
dynamicPublishPage: { page: 7, params: (e) => ({ server_id: e.serverId, channel_id: e.channelId }) },
|
|
1146
1183
|
profileEditPage: { page: 10 },
|
|
1147
1184
|
douyinMallPage: { page: 14 },
|
|
1148
1185
|
likeListPage: { page: 15, params: (e) => ({ dynamicId: e.dynamicId, publishType: e.publishType }) },
|
|
1149
1186
|
adPage: { page: 16, params: (e) => ({ url: e.url }) }
|
|
1150
|
-
},
|
|
1187
|
+
}, Ut = {
|
|
1151
1188
|
bindGamePage: { method: "pointsMallBindGame", data: (e) => ({ gameName: e.gameName, serverId: e.serverId }) },
|
|
1152
1189
|
addCustomEmojiPage: { method: "openAddCustomEmoji", data: () => ({}) }
|
|
1153
1190
|
};
|
|
1154
|
-
function
|
|
1191
|
+
function Ht(e, n) {
|
|
1155
1192
|
var r, i, o;
|
|
1156
|
-
const t =
|
|
1157
|
-
if (t &&
|
|
1158
|
-
const s =
|
|
1193
|
+
const t = Dt((r = n.type) != null ? r : "");
|
|
1194
|
+
if (t && Re(t.route.since)) {
|
|
1195
|
+
const s = Ut[t.key];
|
|
1159
1196
|
if (s) return { via: "legacyMethod", method: s.method, data: s.data(n) };
|
|
1160
|
-
const d =
|
|
1197
|
+
const d = xt[t.key];
|
|
1161
1198
|
if (!d) {
|
|
1162
|
-
const { name: a, type: y, since:
|
|
1163
|
-
return { via: "unsupported", reason: `${a}(type ${y})需要 App ${
|
|
1199
|
+
const { name: a, type: y, since: A } = t.route;
|
|
1200
|
+
return { via: "unsupported", reason: `${a}(type ${y})需要 App ${A}+` };
|
|
1164
1201
|
}
|
|
1165
1202
|
return { via: "redirectPage", page: d.page, params: (o = (i = d.params) == null ? void 0 : i.call(d, n)) != null ? o : {} };
|
|
1166
1203
|
}
|
|
1167
|
-
return
|
|
1204
|
+
return Me() === "ios" ? { via: "redirectPage", page: Nt, params: { url: e } } : { via: "locationHref" };
|
|
1168
1205
|
}
|
|
1169
|
-
function
|
|
1170
|
-
return
|
|
1206
|
+
function Ft(e, n) {
|
|
1207
|
+
return Oe() ? w(L) ? Ht(e.url, e.query) : { via: "openScheme", extra: n } : { via: "launchOutsideApp" };
|
|
1171
1208
|
}
|
|
1172
|
-
function
|
|
1209
|
+
function Wt(e, n, t, r) {
|
|
1173
1210
|
switch (n.via) {
|
|
1174
1211
|
case "launchOutsideApp":
|
|
1175
|
-
return
|
|
1212
|
+
return te(e, { url: t.url }, () => Rt(t, r == null ? void 0 : r.onLaunchFail), r);
|
|
1176
1213
|
case "openScheme":
|
|
1177
1214
|
return u("openScheme", { url: t.url, ...n.extra }, r, { queue: "serial" });
|
|
1178
1215
|
case "redirectPage":
|
|
@@ -1183,143 +1220,141 @@ function Ft(e, n, t, r) {
|
|
|
1183
1220
|
case "legacyMethod":
|
|
1184
1221
|
return u(n.method, n.data, r, { since: L, queue: "serial" });
|
|
1185
1222
|
case "locationHref":
|
|
1186
|
-
return
|
|
1223
|
+
return te(e, { url: t.url }, () => {
|
|
1187
1224
|
window.location.href = t.url;
|
|
1188
1225
|
}, r);
|
|
1189
1226
|
case "unsupported":
|
|
1190
|
-
return
|
|
1227
|
+
return ue(e, n.reason, r);
|
|
1191
1228
|
}
|
|
1192
1229
|
}
|
|
1193
|
-
function
|
|
1194
|
-
const i =
|
|
1195
|
-
return
|
|
1230
|
+
function Fe(e, n, t, r = {}) {
|
|
1231
|
+
const i = Ft(n, r);
|
|
1232
|
+
return Wt(e, i, n, t);
|
|
1196
1233
|
}
|
|
1197
|
-
function
|
|
1234
|
+
function se(e, n) {
|
|
1198
1235
|
let t;
|
|
1199
1236
|
try {
|
|
1200
|
-
t =
|
|
1237
|
+
t = $t(e);
|
|
1201
1238
|
} catch (r) {
|
|
1202
|
-
return c(e.api, r instanceof
|
|
1239
|
+
return c(e.api, r instanceof p ? r.message : String(r), n);
|
|
1203
1240
|
}
|
|
1204
|
-
return
|
|
1205
|
-
}
|
|
1206
|
-
function Ht(e) {
|
|
1207
|
-
return oe({ api: "switchTab", params: e }, e);
|
|
1208
|
-
}
|
|
1209
|
-
function Wt(e) {
|
|
1210
|
-
return oe({ api: "navigateTo", params: e }, e);
|
|
1241
|
+
return Fe(e.api, t, n);
|
|
1211
1242
|
}
|
|
1212
1243
|
function Gt(e) {
|
|
1213
|
-
return
|
|
1244
|
+
return se({ api: "switchTab", params: e }, e);
|
|
1214
1245
|
}
|
|
1215
1246
|
function Vt(e) {
|
|
1247
|
+
return se({ api: "navigateTo", params: e }, e);
|
|
1248
|
+
}
|
|
1249
|
+
function Jt(e) {
|
|
1250
|
+
return se({ api: "openWebview", params: e }, e);
|
|
1251
|
+
}
|
|
1252
|
+
function Kt(e) {
|
|
1216
1253
|
var r;
|
|
1217
1254
|
const { url: n, params: t } = e != null ? e : {};
|
|
1218
|
-
return !f(n) || !n.startsWith(
|
|
1255
|
+
return !f(n) || !n.startsWith(ve) ? c("openScheme", `url must start with ${ve}`, e) : Fe("openScheme", { url: n, query: (r = He(n)) != null ? r : {} }, e, t ? { params: t } : {});
|
|
1219
1256
|
}
|
|
1220
|
-
function
|
|
1257
|
+
function zt(e) {
|
|
1221
1258
|
return e != null && e.url ? u("openInExternalBrowser", { url: e.url }, e, {
|
|
1222
1259
|
since: L,
|
|
1223
1260
|
queue: "serial"
|
|
1224
1261
|
}) : c("openInExternalBrowser", "url is required", e);
|
|
1225
1262
|
}
|
|
1226
|
-
function
|
|
1263
|
+
function Yt(e) {
|
|
1227
1264
|
return u("closeWebView", {}, e, { since: L, queue: "serial" });
|
|
1228
1265
|
}
|
|
1229
|
-
const
|
|
1266
|
+
const Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1230
1267
|
__proto__: null,
|
|
1231
|
-
closeWebView:
|
|
1232
|
-
navigateTo:
|
|
1233
|
-
openInExternalBrowser:
|
|
1234
|
-
openScheme:
|
|
1235
|
-
openWebview:
|
|
1236
|
-
switchTab:
|
|
1237
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1238
|
-
...
|
|
1239
|
-
...
|
|
1240
|
-
...
|
|
1241
|
-
setDebug:
|
|
1242
|
-
registerNativeHandler:
|
|
1268
|
+
closeWebView: Yt,
|
|
1269
|
+
navigateTo: Vt,
|
|
1270
|
+
openInExternalBrowser: zt,
|
|
1271
|
+
openScheme: Kt,
|
|
1272
|
+
openWebview: Jt,
|
|
1273
|
+
switchTab: Gt
|
|
1274
|
+
}, Symbol.toStringTag, { value: "Module" })), ur = {
|
|
1275
|
+
...rt,
|
|
1276
|
+
...Xt,
|
|
1277
|
+
...Ct,
|
|
1278
|
+
setDebug: hn,
|
|
1279
|
+
registerNativeHandler: Be
|
|
1243
1280
|
};
|
|
1244
1281
|
export {
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1282
|
+
z as BRIDGE_ERROR,
|
|
1283
|
+
Ie as CUSTOM,
|
|
1284
|
+
Je as ENV_UNSUPPORTED,
|
|
1285
|
+
Ge as METHOD_NOT_FOUND,
|
|
1286
|
+
nr as NETWORK_ERROR,
|
|
1287
|
+
Zt as NOT_LOGGED_IN,
|
|
1288
|
+
Ve as PARAMS_ERROR,
|
|
1289
|
+
er as PERMISSION_DENIED,
|
|
1290
|
+
tr as RECORD_BUSY,
|
|
1291
|
+
rr as RECORD_FAILED,
|
|
1292
|
+
Pe as SUCCESS,
|
|
1293
|
+
re as SYSTEM_EXCEPTION,
|
|
1294
|
+
H as ShareType,
|
|
1295
|
+
je as ToastDuration,
|
|
1296
|
+
bt as bindGameRoleSuccess,
|
|
1297
|
+
$n as cancelRecordAudio,
|
|
1298
|
+
Fn as checkPermission,
|
|
1299
|
+
Rn as chooseMedia,
|
|
1300
|
+
Yt as closeWebView,
|
|
1301
|
+
gn as compareVersions,
|
|
1302
|
+
ur as default,
|
|
1266
1303
|
B as getAppBaseInfo,
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
Qn as offPageVisible,
|
|
1285
|
-
pt as onAdFinished,
|
|
1304
|
+
zn as getBeforeInfo,
|
|
1305
|
+
Un as getClipboardData,
|
|
1306
|
+
ut as getCurrentCircleInfo,
|
|
1307
|
+
Nn as getSystemInfo,
|
|
1308
|
+
ot as getToken,
|
|
1309
|
+
Kn as h5Loaded,
|
|
1310
|
+
kn as hideKeyboard,
|
|
1311
|
+
or as invokeDebug,
|
|
1312
|
+
Oe as isInApp,
|
|
1313
|
+
it as login,
|
|
1314
|
+
Vt as navigateTo,
|
|
1315
|
+
qn as offCommentPanelChange,
|
|
1316
|
+
Sn as offKeyboardHeightChange,
|
|
1317
|
+
kt as offMemberActivate,
|
|
1318
|
+
tt as offPageInvisible,
|
|
1319
|
+
Qn as offPageShow,
|
|
1320
|
+
et as offPageVisible,
|
|
1286
1321
|
An as onCommentPanelChange,
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1322
|
+
Cn as onKeyboardHeightChange,
|
|
1323
|
+
Et as onMemberActivate,
|
|
1324
|
+
nt as onPageInvisible,
|
|
1325
|
+
Xn as onPageShow,
|
|
1326
|
+
Zn as onPageVisible,
|
|
1327
|
+
ir as onRoute,
|
|
1328
|
+
at as openAddCustomEmoji,
|
|
1329
|
+
Gn as openApp,
|
|
1330
|
+
lt as openCommentPanel,
|
|
1331
|
+
yt as openFriendsList,
|
|
1332
|
+
Pt as openGiftBag,
|
|
1333
|
+
zt as openInExternalBrowser,
|
|
1334
|
+
Wn as openPhoneSetting,
|
|
1335
|
+
Kt as openScheme,
|
|
1336
|
+
Jt as openWebview,
|
|
1337
|
+
_n as previewImage,
|
|
1338
|
+
On as previewVideo,
|
|
1339
|
+
Be as registerNativeHandler,
|
|
1340
|
+
Ln as saveImageToPhotosAlbum,
|
|
1341
|
+
Yn as setBeforeInfo,
|
|
1342
|
+
xn as setClipboardData,
|
|
1343
|
+
hn as setDebug,
|
|
1344
|
+
dt as shareImage,
|
|
1345
|
+
st as shareWebCard,
|
|
1346
|
+
mt as showAd,
|
|
1347
|
+
ft as showLongVipDesDialog,
|
|
1348
|
+
Jn as showPageName,
|
|
1349
|
+
Pn as showToast,
|
|
1350
|
+
Dn as startRecordAudio,
|
|
1351
|
+
jn as stopRecordAudio,
|
|
1352
|
+
En as stopVibrate,
|
|
1353
|
+
Vn as swipeBack,
|
|
1354
|
+
Gt as switchTab,
|
|
1355
|
+
pt as toBindGameRole,
|
|
1356
|
+
In as triggerVibrate,
|
|
1357
|
+
vt as updateData,
|
|
1358
|
+
Tn as uploadFiles,
|
|
1359
|
+
gt as voteAction
|
|
1325
1360
|
};
|