dimsum-chat 0.3.8 → 0.4.1
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/dist/dimsum-chat.js +411 -166
- package/dist/dimsum-chat.umd.cjs +4 -4
- package/dist/emots/kuaishou-emots.d.ts +1 -0
- package/dist/parser.d.ts +3 -1
- package/package.json +1 -1
package/dist/dimsum-chat.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var T = (
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
var I = Object.defineProperty;
|
|
2
|
+
var T = (a, t, i) => t in a ? I(a, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : a[t] = i;
|
|
3
|
+
var r = (a, t, i) => (T(a, typeof t != "symbol" ? t + "" : t, i), i);
|
|
4
|
+
const A = {
|
|
5
5
|
type: "LIVE_OPEN_PLATFORM_DM",
|
|
6
6
|
content: {
|
|
7
7
|
cmd: "LIVE_OPEN_PLATFORM_DM",
|
|
@@ -14,7 +14,7 @@ const B = {
|
|
|
14
14
|
dm_type: 0
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
},
|
|
17
|
+
}, B = {
|
|
18
18
|
type: "LIVE_OPEN_PLATFORM_SEND_GIFT",
|
|
19
19
|
content: {
|
|
20
20
|
cmd: "LIVE_OPEN_PLATFORM_SEND_GIFT",
|
|
@@ -30,62 +30,62 @@ const B = {
|
|
|
30
30
|
gift_icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAB+FBMVEX/////UFD/TFD/TVD/TE7/TU//TU//TU//SUv/Skz/Sk3/S03/S07/TE3/TE7/TE//TU7/TU//TVD/Tk//TlD/T1D/T1H/UFH/UFL/UFP/UVL/UVP/UlP/UlT/U1T/U1X/VFX/VFb/VVb/VVf/Vlf/Vlj/V1j/V1n/WFn/WFr/WVr/WVv/Wlv/Wlz/W1z/W13/XF3/XF7/XV7/X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vPZtwCIo1BSTDpXxOfnlYu5ND7rMIbnWA+aj/BM2gUYdJwilJgYyJDKKtcS4IpKYsMu21cVZHPjq0GyveGQK6lcuxsbXwmShBvHFTR4d46rR5LY3PhKkCwrj6tmJ7sbnrJzVTi2N1bI1tUolM2NlXJt9wqo1bUNP7KZuKq11dXSr62NdeRlRdldDwMr2M7Lx7KzuRFINrdfIpbdoBQGzPZuIvEigRKJnZ2tlRr1/4Wmmz6Gx9JTAAAAAElFTkSuQmCC"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
},
|
|
33
|
+
}, _ = [A, B], m = class m {
|
|
34
34
|
constructor() {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
r(this, "AUTH_HOST", "https://dimsum-widget-auth-1301031323.cos.ap-guangzhou.myqcloud.com");
|
|
36
|
+
r(this, "WHITELIST_WIDGETS", ["dimsum-bonk-2024-widget", "douyin-bonk-2024-widget"]);
|
|
37
|
+
r(this, "MAX_RETRY_COUNT", 3);
|
|
38
|
+
r(this, "authenticatedPlatformAndRoomId");
|
|
39
|
+
r(this, "isPiracy", !1);
|
|
40
|
+
r(this, "retryCount", 0);
|
|
41
41
|
}
|
|
42
42
|
static getInstance() {
|
|
43
|
-
return
|
|
43
|
+
return m.instance || (m.instance = new m()), m.instance;
|
|
44
44
|
}
|
|
45
45
|
updateWidgetId(t) {
|
|
46
46
|
return t === "douyin-bonk-2024-widget" ? "dimsum-bonk-2024-widget" : t;
|
|
47
47
|
}
|
|
48
|
-
checkAuthentication(t,
|
|
49
|
-
if (t = this.updateWidgetId(t), !this.WHITELIST_WIDGETS.includes(t) || this.authenticatedPlatformAndRoomId === `${
|
|
48
|
+
checkAuthentication(t, i, s) {
|
|
49
|
+
if (t = this.updateWidgetId(t), !this.WHITELIST_WIDGETS.includes(t) || this.authenticatedPlatformAndRoomId === `${i}-${s}`)
|
|
50
50
|
return;
|
|
51
|
-
const
|
|
51
|
+
const e = () => {
|
|
52
52
|
this.retryCount++, this.retryCount < this.MAX_RETRY_COUNT ? setTimeout(() => {
|
|
53
|
-
this.checkAuthentication(t,
|
|
53
|
+
this.checkAuthentication(t, i, s);
|
|
54
54
|
}, 1e3) : this.isPiracy = !0;
|
|
55
|
-
}, n = `${this.AUTH_HOST}/${t}/whitelist/${
|
|
56
|
-
return fetch(n).then((
|
|
57
|
-
console.log("checkAuthentication",
|
|
55
|
+
}, n = `${this.AUTH_HOST}/${t}/whitelist/${i}/${s}`;
|
|
56
|
+
return fetch(n).then((p) => {
|
|
57
|
+
console.log("checkAuthentication", p.status), p.status === 200 ? (this.authenticatedPlatformAndRoomId = `${i}-${s}`, this.isPiracy = !1) : e();
|
|
58
58
|
}).catch(() => {
|
|
59
|
-
console.log("checkAuthentication error"),
|
|
59
|
+
console.log("checkAuthentication error"), e();
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
passMessage(t) {
|
|
63
63
|
try {
|
|
64
64
|
if (t.type === "DimSumChatRoomInfo") {
|
|
65
|
-
const
|
|
66
|
-
this.checkAuthentication(
|
|
65
|
+
const i = t.content.platform ?? t.content.platfrom, s = t.content.roomId, e = window.location.pathname.split("/")[1];
|
|
66
|
+
this.checkAuthentication(e, i, s);
|
|
67
67
|
}
|
|
68
68
|
if (t.type === "INTERACT_WORD") {
|
|
69
|
-
const
|
|
70
|
-
this.checkAuthentication(n,
|
|
69
|
+
const i = typeof t.content == "object" ? t.content : JSON.parse(t.content), s = "bilibili", e = String(i.data.roomid), n = window.location.pathname.split("/")[1];
|
|
70
|
+
this.checkAuthentication(n, s, e);
|
|
71
71
|
}
|
|
72
72
|
if (t.type === "LIVE_OPEN_PLATFORM_DM" || t.type === "LIVE_OPEN_PLATFORM_SEND_GIFT") {
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
73
|
+
const i = typeof t.content == "object" ? t.content : JSON.parse(t.content);
|
|
74
|
+
if (i.data.room_id === void 0)
|
|
75
75
|
return t;
|
|
76
|
-
const
|
|
77
|
-
this.checkAuthentication(n,
|
|
76
|
+
const s = "bilibili", e = String(i.data.room_id), n = window.location.pathname.split("/")[1];
|
|
77
|
+
this.checkAuthentication(n, s, e);
|
|
78
78
|
}
|
|
79
79
|
if (this.isPiracy)
|
|
80
|
-
return
|
|
81
|
-
} catch (
|
|
82
|
-
console.log("DimSumAuth error",
|
|
80
|
+
return _[Math.floor(Math.random() * _.length)];
|
|
81
|
+
} catch (i) {
|
|
82
|
+
console.log("DimSumAuth error", i);
|
|
83
83
|
}
|
|
84
84
|
return t;
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
|
|
88
|
-
let
|
|
87
|
+
r(m, "instance");
|
|
88
|
+
let y = m;
|
|
89
89
|
const M = {
|
|
90
90
|
type: "LIVE_OPEN_PLATFORM_DM",
|
|
91
91
|
content: {
|
|
@@ -108,7 +108,7 @@ const M = {
|
|
|
108
108
|
guard_level: 1
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
},
|
|
111
|
+
}, D = {
|
|
112
112
|
connected: M,
|
|
113
113
|
welcome: E
|
|
114
114
|
};
|
|
@@ -116,9 +116,9 @@ function L() {
|
|
|
116
116
|
const t = window.location.pathname.split("/");
|
|
117
117
|
return t.length > 1 ? t[1] : "unknown base name";
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function k(a) {
|
|
120
120
|
let t;
|
|
121
|
-
switch (
|
|
121
|
+
switch (a.type) {
|
|
122
122
|
case "DimSumChatWidgetInfoRequest":
|
|
123
123
|
t = {
|
|
124
124
|
type: "DimSumChatWidgetInfoResponse",
|
|
@@ -130,20 +130,20 @@ function S(o) {
|
|
|
130
130
|
}
|
|
131
131
|
return t;
|
|
132
132
|
}
|
|
133
|
-
const
|
|
133
|
+
const x = class x {
|
|
134
134
|
constructor() {
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
r(this, "webSocket");
|
|
136
|
+
r(this, "messageListeners");
|
|
137
137
|
this.webSocket = null, this.messageListeners = [];
|
|
138
138
|
}
|
|
139
139
|
static getInstance() {
|
|
140
|
-
return
|
|
140
|
+
return x.instance || (x.instance = new x()), x.instance;
|
|
141
141
|
}
|
|
142
142
|
connect(t) {
|
|
143
143
|
this.webSocket || (this.webSocket = new WebSocket(t), this.webSocket.onmessage = this.handleMessage.bind(this), this.webSocket.onopen = () => {
|
|
144
144
|
console.log("connected"), setTimeout(() => {
|
|
145
145
|
this.messageListeners.forEach(
|
|
146
|
-
(
|
|
146
|
+
(i) => i(JSON.stringify(D.connected))
|
|
147
147
|
);
|
|
148
148
|
}, 100);
|
|
149
149
|
}, this.webSocket.onclose = () => {
|
|
@@ -154,41 +154,41 @@ const h = class h {
|
|
|
154
154
|
}
|
|
155
155
|
handleMessage(t) {
|
|
156
156
|
var n;
|
|
157
|
-
const
|
|
158
|
-
this.messageListeners.forEach((
|
|
159
|
-
const
|
|
160
|
-
|
|
157
|
+
const i = t.data;
|
|
158
|
+
this.messageListeners.forEach((p) => p(i));
|
|
159
|
+
const s = JSON.parse(i), e = k(s);
|
|
160
|
+
e && ((n = this.webSocket) == null || n.send(JSON.stringify(e)));
|
|
161
161
|
}
|
|
162
162
|
addMessageListener(t) {
|
|
163
163
|
this.messageListeners.push(t), setTimeout(() => {
|
|
164
|
-
t(JSON.stringify(
|
|
164
|
+
t(JSON.stringify(D.welcome));
|
|
165
165
|
}, 100);
|
|
166
166
|
}
|
|
167
167
|
removeMessageListener(t) {
|
|
168
|
-
const
|
|
169
|
-
|
|
168
|
+
const i = this.messageListeners.indexOf(t);
|
|
169
|
+
i !== -1 && this.messageListeners.splice(i, 1);
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
|
-
|
|
173
|
-
let
|
|
174
|
-
function
|
|
175
|
-
const
|
|
176
|
-
return `${t}//${
|
|
172
|
+
r(x, "instance");
|
|
173
|
+
let l = x;
|
|
174
|
+
function S() {
|
|
175
|
+
const a = new URL(window.location.href), t = a.protocol === "https:" ? "wss:" : "ws:", i = a.host;
|
|
176
|
+
return `${t}//${i}/websocket`;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
const t = new URL(window.location.href),
|
|
180
|
-
return `${
|
|
178
|
+
function U(a) {
|
|
179
|
+
const t = new URL(window.location.href), i = t.protocol, s = t.host;
|
|
180
|
+
return `${i}//${s}/bface/${a}`;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function R(a, t = {}) {
|
|
183
183
|
const {
|
|
184
|
-
customWsServer:
|
|
185
|
-
} = t,
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
|
|
184
|
+
customWsServer: i = S()
|
|
185
|
+
} = t, s = y.getInstance(), e = l.getInstance();
|
|
186
|
+
e.connect(i), e.addMessageListener((n) => {
|
|
187
|
+
const p = JSON.parse(n), g = s.passMessage(p), f = new j(g);
|
|
188
|
+
a(g, f);
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
const
|
|
191
|
+
const z = [
|
|
192
192
|
["[过年牛]", "https://p3-pc-sign.douyinpic.com/obj/tos-cn-i-tsj2vxp0zn/3bb984085d52480ca846fa8f9a1782f6?x-expires=1949886000&x-signature=d8vUokaGkWD%2B4sAHNTLJquCrHrs%3D"],
|
|
193
193
|
["[元宝]", "https://p3-pc-sign.douyinpic.com/obj/tos-cn-i-tsj2vxp0zn/5f8ac1b1ddd347c4be34b81b496fcc45?x-expires=2023614000&x-signature=UT%2F8fnFld4xuvjj2bttu6fh76lI%3D"],
|
|
194
194
|
["[鞭炮]", "https://p3-pc-sign.douyinpic.com/obj/tos-cn-i-tsj2vxp0zn/02f8ee9536de4c6595171584e2322f0f?x-expires=2023614000&x-signature=Aa8eXgZqb0bx0QNeLONQVgNUbLI%3D"],
|
|
@@ -449,7 +449,7 @@ const C = [
|
|
|
449
449
|
["[糖葫芦]", "https://p3-pc-sign.douyinpic.com/obj/tos-cn-i-tsj2vxp0zn/d4aa8a0ff46a445e861ad8fb78c07140?x-expires=2023614000&x-signature=FvN4ytTGjC7Mww8KX4BRIg9wcTE%3D"],
|
|
450
450
|
["[虎头]", "https://p3-pc-sign.douyinpic.com/obj/tos-cn-i-tsj2vxp0zn/7569ffeaa3894b8b8ea843c0e5a05f63?x-expires=2023614000&x-signature=m%2Bi3d034xBQkuBqx4xrvzru5q6A%3D"],
|
|
451
451
|
["[iloveyou]", "https://p3-pc-sign.douyinpic.com/obj/tos-cn-i-tsj2vxp0zn/798bcfd9811f4fcd97df92af06c87a0e?x-expires=2023614000&x-signature=DuK8xhX7glgLx44H53PrhM32D44%3D"]
|
|
452
|
-
],
|
|
452
|
+
], C = [
|
|
453
453
|
["[dog]", "http://i0.hdslb.com/bfs/live/4428c84e694fbf4e0ef6c06e958d9352c3582740.png"],
|
|
454
454
|
["[花]", "http://i0.hdslb.com/bfs/live/7dd2ef03e13998575e4d8a803c6e12909f94e72b.png"],
|
|
455
455
|
["[妙]", "http://i0.hdslb.com/bfs/live/08f735d950a0fba267dda140673c9ab2edf6410d.png"],
|
|
@@ -532,25 +532,233 @@ const C = [
|
|
|
532
532
|
["[抱拳]", "http://i0.hdslb.com/bfs/live/3f170894dd08827ee293afcb5a3d2b60aecdb5b1.png"],
|
|
533
533
|
["[给力]", "http://i0.hdslb.com/bfs/live/d1ba5f4c54332a21ed2ca0dcecaedd2add587839.png"],
|
|
534
534
|
["[耶]", "http://i0.hdslb.com/bfs/live/eb2d84ba623e2335a48f73fb5bef87bcf53c1239.png"]
|
|
535
|
-
],
|
|
535
|
+
], w = [
|
|
536
|
+
["[666]", "https://ali2.a.yximgs.com/bs2/emotion/1704763447505third_party_s1296657489.png"],
|
|
537
|
+
["[奸笑]", "https://ali2.a.yximgs.com/bs2/emotion/1704776059816third_party_s1296748052.png"],
|
|
538
|
+
["[捂脸]", "https://bd.a.yximgs.com/bs2/emotion/1704776021202third_party_s1296747457.png"],
|
|
539
|
+
["[龇牙]", "https://bd.a.yximgs.com/bs2/emotion/1704775978144third_party_s1296746882.png"],
|
|
540
|
+
["[哼]", "https://ali2.a.yximgs.com/bs2/emotion/1704775935917third_party_s1296746407.png"],
|
|
541
|
+
["[哦]", "https://ali2.a.yximgs.com/bs2/emotion/1704775888472third_party_s1296745888.png"],
|
|
542
|
+
["[微笑]", "https://ali2.a.yximgs.com/bs2/emotion/1704775840073third_party_s1296745254.png"],
|
|
543
|
+
["[老铁]", "https://ali2.a.yximgs.com/bs2/emotion/1704766004548third_party_s1296668542.png"],
|
|
544
|
+
["[双鸡]", "https://ali2.a.yximgs.com/bs2/emotion/1704765943430third_party_s1296668337.png"],
|
|
545
|
+
["[调皮]", "https://ali2.a.yximgs.com/bs2/emotion/1704775798640third_party_s1296744691.png"],
|
|
546
|
+
["[呆住]", "https://ali2.a.yximgs.com/bs2/emotion/1704775755675third_party_s1296744198.png"],
|
|
547
|
+
["[星星眼]", "https://ali2.a.yximgs.com/bs2/emotion/1704775705283third_party_s1296743591.png"],
|
|
548
|
+
["[爱心]", "https://ali2.a.yximgs.com/bs2/emotion/1704765876094third_party_s1296667852.png"],
|
|
549
|
+
["[疑问]", "https://ali2.a.yximgs.com/bs2/emotion/1704775660342third_party_s1296742992.png"],
|
|
550
|
+
["[生气]", "https://ali2.a.yximgs.com/bs2/emotion/1704775610489third_party_s1296742417.png"],
|
|
551
|
+
["[难过]", "https://ali2.a.yximgs.com/bs2/emotion/1704775560543third_party_s1296741805.png"],
|
|
552
|
+
["[撇嘴]", "https://ali2.a.yximgs.com/bs2/emotion/1704775517486third_party_s1296741380.png"],
|
|
553
|
+
["[惊讶]", "https://ali2.a.yximgs.com/bs2/emotion/1704775445666third_party_s1296740420.png"],
|
|
554
|
+
["[羞涩]", "https://ali2.a.yximgs.com/bs2/emotion/1704772289790third_party_s1296705324.png"],
|
|
555
|
+
["[色]", "https://ali2.a.yximgs.com/bs2/emotion/1704772231770third_party_s1296704846.png"],
|
|
556
|
+
["[汗]", "https://ali2.a.yximgs.com/bs2/emotion/1704772177310third_party_s1296704283.png"],
|
|
557
|
+
["[呕吐]", "https://ali2.a.yximgs.com/bs2/emotion/1704772118979third_party_s1296703810.png"],
|
|
558
|
+
["[老司机]", "https://ali2.a.yximgs.com/bs2/emotion/1704772048844third_party_s1296703216.png"],
|
|
559
|
+
["[头盔]", "https://ali2.a.yximgs.com/bs2/emotion/1704771654524third_party_s1296700611.png"],
|
|
560
|
+
["[酷]", "https://ali2.a.yximgs.com/bs2/emotion/1704771603139third_party_s1296700263.png"],
|
|
561
|
+
["[笑哭]", "https://ali2.a.yximgs.com/bs2/emotion/1704771554781third_party_s1296699971.png"],
|
|
562
|
+
["[愉快]", "https://ali2.a.yximgs.com/bs2/emotion/1704771498312third_party_s1296699382.png"],
|
|
563
|
+
["[委屈]", "https://ali2.a.yximgs.com/bs2/emotion/1704771450694third_party_s1296699070.png"],
|
|
564
|
+
["[鄙视]", "https://ali2.a.yximgs.com/bs2/emotion/1704771395457third_party_s1296698891.png"],
|
|
565
|
+
["[白眼]", "https://ali2.a.yximgs.com/bs2/emotion/1704771346135third_party_s1296698660.png"],
|
|
566
|
+
["[安排]", "https://ali2.a.yximgs.com/bs2/emotion/1704771294552third_party_s1296698182.png"],
|
|
567
|
+
["[点点关注]", "https://ali2.a.yximgs.com/bs2/emotion/1704771236940third_party_s1296697797.png"],
|
|
568
|
+
["[鼓掌]", "https://ali2.a.yximgs.com/bs2/emotion/1704771184363third_party_s1296697359.png"],
|
|
569
|
+
["[抱抱]", "https://ali2.a.yximgs.com/bs2/emotion/1704766474596third_party_s1296670536.png"],
|
|
570
|
+
["[哈欠]", "https://ali2.a.yximgs.com/bs2/emotion/1704771131055third_party_s1296696977.png"],
|
|
571
|
+
["[骂你]", "https://bd.a.yximgs.com/bs2/emotion/1704771079728third_party_s1296696446.png"],
|
|
572
|
+
["[大哭]", "https://ali2.a.yximgs.com/bs2/emotion/1704771028940third_party_s1296696033.png"],
|
|
573
|
+
["[闭嘴]", "https://ali2.a.yximgs.com/bs2/emotion/1704770709451third_party_s1296694128.png"],
|
|
574
|
+
["[惊恐]", "https://bd.a.yximgs.com/bs2/emotion/1704770650664third_party_s1296693781.png"],
|
|
575
|
+
["[红脸蛋]", "https://ali2.a.yximgs.com/bs2/emotion/1704770591150third_party_s1296693499.png"],
|
|
576
|
+
["[亲亲]", "https://bd.a.yximgs.com/bs2/emotion/1704770453439third_party_s1296692624.png"],
|
|
577
|
+
["[冷汗]", "https://ali2.a.yximgs.com/bs2/emotion/1704770395028third_party_s1296692231.png"],
|
|
578
|
+
["[晕]", "https://ali2.a.yximgs.com/bs2/emotion/1704770038072third_party_s1296690336.png"],
|
|
579
|
+
["[皇冠]", "https://ali2.a.yximgs.com/bs2/emotion/1704765811100third_party_s1296667470.png"],
|
|
580
|
+
["[火]", "https://ali2.a.yximgs.com/bs2/emotion/1704763504359third_party_s1296657659.png"],
|
|
581
|
+
["[坏笑]", "https://ali2.a.yximgs.com/bs2/emotion/1704769906157third_party_s1296689515.png"],
|
|
582
|
+
["[爆炸]", "https://ali2.a.yximgs.com/bs2/emotion/1704763342710third_party_s1296657261.png"],
|
|
583
|
+
["[大便]", "https://ali2.a.yximgs.com/bs2/emotion/1704763289677third_party_s1296657112.png"],
|
|
584
|
+
["[可怜]", "https://ali2.a.yximgs.com/bs2/emotion/1704769849712third_party_s1296689281.png"],
|
|
585
|
+
["[抠鼻]", "https://ali2.a.yximgs.com/bs2/emotion/1704769802638third_party_s1296689012.png"],
|
|
586
|
+
["[再见]", "https://ali2.a.yximgs.com/bs2/emotion/1704769742626third_party_s1296688705.png"],
|
|
587
|
+
["[摄像机]", "https://ali2.a.yximgs.com/bs2/emotion/1704763241589third_party_s1296656998.png"],
|
|
588
|
+
["[赞]", "https://ali2.a.yximgs.com/bs2/emotion/1704762153449third_party_s1296652881.png"],
|
|
589
|
+
["[平底锅]", "https://ali2.a.yximgs.com/bs2/emotion/1704769687542third_party_s1296688270.png"],
|
|
590
|
+
["[囧]", "https://bd.a.yximgs.com/bs2/emotion/1704769626325third_party_s1296687863.png"],
|
|
591
|
+
["[大哥]", "https://ali2.a.yximgs.com/bs2/emotion/1704769568039third_party_s1296687559.png"],
|
|
592
|
+
["[玫瑰]", "https://bd.a.yximgs.com/bs2/emotion/1704763142635third_party_s1296656612.png"],
|
|
593
|
+
["[抓狂]", "https://ali2.a.yximgs.com/bs2/emotion/1704769507289third_party_s1296687303.png"],
|
|
594
|
+
["[嘘]", "https://ali2.a.yximgs.com/bs2/emotion/1704769442407third_party_s1296686829.png"],
|
|
595
|
+
["[快哭了]", "https://ali2.a.yximgs.com/bs2/emotion/1704769347108third_party_s1296686284.png"],
|
|
596
|
+
["[骷髅]", "https://ali2.a.yximgs.com/bs2/emotion/1704768884061third_party_s1296683458.png"],
|
|
597
|
+
["[偷笑]", "https://ali2.a.yximgs.com/bs2/emotion/1704768706672third_party_s1296682428.png"],
|
|
598
|
+
["[落泪]", "https://bd.a.yximgs.com/bs2/emotion/1704768657909third_party_s1296681906.png"],
|
|
599
|
+
["[挑逗]", "https://ali2.a.yximgs.com/bs2/emotion/1704768600457third_party_s1296681529.png"],
|
|
600
|
+
["[困]", "https://ali2.a.yximgs.com/bs2/emotion/1704768550467third_party_s1296681259.png"],
|
|
601
|
+
["[睡觉]", "https://ali2.a.yximgs.com/bs2/emotion/1704768494268third_party_s1296681034.png"],
|
|
602
|
+
["[右哼哼]", "https://ali2.a.yximgs.com/bs2/emotion/1704768448493third_party_s1296680688.png"],
|
|
603
|
+
["[左哼哼]", "https://ali2.a.yximgs.com/bs2/emotion/1704768392482third_party_s1296680332.png"],
|
|
604
|
+
["[打招呼]", "https://ali2.a.yximgs.com/bs2/emotion/1704762100195third_party_s1296652661.png"],
|
|
605
|
+
["[流鼻血]", "https://ali2.a.yximgs.com/bs2/emotion/1704768330183third_party_s1296680037.png"],
|
|
606
|
+
["[偷瞄]", "https://ali2.a.yximgs.com/bs2/emotion/1704768270249third_party_s1296679827.png"],
|
|
607
|
+
["[吃瓜]", "https://ali2.a.yximgs.com/bs2/emotion/1704768220721third_party_s1296679581.png"],
|
|
608
|
+
["[黑脸问]", "https://ali2.a.yximgs.com/bs2/emotion/1704768168791third_party_s1296679234.png"],
|
|
609
|
+
["[旋转]", "https://bd.a.yximgs.com/bs2/emotion/1704768117560third_party_s1296678783.png"],
|
|
610
|
+
["[憨笑]", "https://ali2.a.yximgs.com/bs2/emotion/1704768054223third_party_s1296678500.png"],
|
|
611
|
+
["[吐彩虹]", "https://ali2.a.yximgs.com/bs2/emotion/1704767994674third_party_s1296678327.png"],
|
|
612
|
+
["[擦鼻涕]", "https://ali2.a.yximgs.com/bs2/emotion/1704767940928third_party_s1296677841.png"],
|
|
613
|
+
["[怒言]", "https://ali2.a.yximgs.com/bs2/emotion/1704767890021third_party_s1296677678.png"],
|
|
614
|
+
["[拜托]", "https://ali2.a.yximgs.com/bs2/emotion/1704767838535third_party_s1296677360.png"],
|
|
615
|
+
["[加油]", "https://bd.a.yximgs.com/bs2/emotion/1704767780611third_party_s1296677057.png"],
|
|
616
|
+
["[暴汗]", "https://ali2.a.yximgs.com/bs2/emotion/1704767728861third_party_s1296676729.png"],
|
|
617
|
+
["[想吃]", "https://ali2.a.yximgs.com/bs2/emotion/1704767667849third_party_s1296676449.png"],
|
|
618
|
+
["[打脸]", "https://ali2.a.yximgs.com/bs2/emotion/1704767617056third_party_s1296676208.png"],
|
|
619
|
+
["[吐血]", "https://ali2.a.yximgs.com/bs2/emotion/1704767567911third_party_s1296675878.png"],
|
|
620
|
+
["[尴尬]", "https://bd.a.yximgs.com/bs2/emotion/1704767506569third_party_s1296675528.png"],
|
|
621
|
+
["[出魂儿]", "https://ali2.a.yximgs.com/bs2/emotion/1704767441130third_party_s1296675286.png"],
|
|
622
|
+
["[大鼻孔]", "https://ali2.a.yximgs.com/bs2/emotion/1704767388991third_party_s1296674947.png"],
|
|
623
|
+
["[嘣]", "https://ali2.a.yximgs.com/bs2/emotion/1704767331411third_party_s1296674616.png"],
|
|
624
|
+
["[天啊]", "https://ali2.a.yximgs.com/bs2/emotion/1704767271335third_party_s1296674239.png"],
|
|
625
|
+
["[石化]", "https://bd.a.yximgs.com/bs2/emotion/1704767221776third_party_s1296674013.png"],
|
|
626
|
+
["[皱眉]", "https://bd.a.yximgs.com/bs2/emotion/1704767005855third_party_s1296672942.png"],
|
|
627
|
+
["[装傻]", "https://ali2.a.yximgs.com/bs2/emotion/1704766945094third_party_s1296672714.png"],
|
|
628
|
+
["[酸了]", "https://ali2.a.yximgs.com/bs2/emotion/1704761625171third_party_s1296650672.png"],
|
|
629
|
+
["[柴犬]", "https://bd.a.yximgs.com/bs2/emotion/1704761562366third_party_s1296650505.png"],
|
|
630
|
+
["[狗粮]", "https://bd.a.yximgs.com/bs2/emotion/1704762211958third_party_s1296653006.png"],
|
|
631
|
+
["[期待]", "https://ali2.a.yximgs.com/bs2/emotion/1704766537316third_party_s1296670779.png"],
|
|
632
|
+
["[红包]", "https://ali2.a.yximgs.com/bs2/emotion/1704762630876third_party_s1296654958.png"],
|
|
633
|
+
["[干杯]", "https://ali2.a.yximgs.com/bs2/emotion/1704762976549third_party_s1296656073.png"],
|
|
634
|
+
["[祈祷]", "https://ali2.a.yximgs.com/bs2/emotion/1704762918273third_party_s1296655765.png"],
|
|
635
|
+
["[花谢了]", "https://bd.a.yximgs.com/bs2/emotion/1704763094568third_party_s1296656398.png"],
|
|
636
|
+
["[跪下]", "https://ali2.a.yximgs.com/bs2/emotion/1704762867899third_party_s1296655667.png"],
|
|
637
|
+
["[南]", "https://ali2.a.yximgs.com/bs2/emotion/1704762761234third_party_s1296655362.png"],
|
|
638
|
+
["[发]", "https://ali2.a.yximgs.com/bs2/emotion/1704762689267third_party_s1296655142.png"],
|
|
639
|
+
["[板砖]", "https://ali2.a.yximgs.com/bs2/emotion/1704763039720third_party_s1296656165.png"],
|
|
640
|
+
["[灯笼]", "https://bd.a.yximgs.com/bs2/emotion/1704762583000third_party_s1296654733.png"],
|
|
641
|
+
["[福字]", "https://ali2.a.yximgs.com/bs2/emotion/1704762521906third_party_s1296654390.png"],
|
|
642
|
+
["[鞭炮]", "https://ali2.a.yximgs.com/bs2/emotion/1704762474616third_party_s1296654064.png"],
|
|
643
|
+
["[烟花]", "https://ali2.a.yximgs.com/bs2/emotion/1704762425707third_party_s1296653845.png"],
|
|
644
|
+
["[元宝]", "https://ali2.a.yximgs.com/bs2/emotion/1704762370541third_party_s1296653559.png"],
|
|
645
|
+
["[钱]", "https://ali2.a.yximgs.com/bs2/emotion/1704762316380third_party_s1296653319.png"],
|
|
646
|
+
["[气球]", "https://ali2.a.yximgs.com/bs2/emotion/1704762265510third_party_s1296653172.png"],
|
|
647
|
+
["[庆祝]", "https://ali2.a.yximgs.com/bs2/emotion/1704770972968third_party_s1296695686.png"],
|
|
648
|
+
["[礼花]", "https://ali2.a.yximgs.com/bs2/emotion/1704766060554third_party_s1296668711.png"],
|
|
649
|
+
["[爱你]", "https://ali2.a.yximgs.com/bs2/emotion/1704766815314third_party_s1296671857.png"],
|
|
650
|
+
["[摸头]", "https://bd.a.yximgs.com/bs2/emotion/1704766657395third_party_s1296671198.png"],
|
|
651
|
+
["[雾霾]", "https://ali2.a.yximgs.com/bs2/emotion/1704766594591third_party_s1296670988.png"],
|
|
652
|
+
["[化妆]", "https://ali2.a.yximgs.com/bs2/emotion/1704766889905third_party_s1296672534.png"],
|
|
653
|
+
["[涂指甲]", "https://ali2.a.yximgs.com/bs2/emotion/1704761682759third_party_s1296650876.png"],
|
|
654
|
+
["[欢迎]", "https://ali2.a.yximgs.com/bs2/emotion/1704762048343third_party_s1296652504.png"],
|
|
655
|
+
["[左拳]", "https://ali2.a.yximgs.com/bs2/emotion/1704761978093third_party_s1296652142.png"],
|
|
656
|
+
["[右拳]", "https://ali2.a.yximgs.com/bs2/emotion/1704761920283third_party_s1296651882.png"],
|
|
657
|
+
["[我爱你]", "https://ali2.a.yximgs.com/bs2/emotion/1704761864978third_party_s1296651546.png"],
|
|
658
|
+
["[比心]", "https://ali2.a.yximgs.com/bs2/emotion/1704761810228third_party_s1296651375.png"],
|
|
659
|
+
["[肌肉]", "https://ali2.a.yximgs.com/bs2/emotion/1704761751472third_party_s1296651098.png"],
|
|
660
|
+
["[狮子]", "https://ali2.a.yximgs.com/bs2/emotion/1704761502720third_party_s1296650143.png"],
|
|
661
|
+
["[龙]", "https://ali2.a.yximgs.com/bs2/emotion/1704761427407third_party_s1296649954.png"],
|
|
662
|
+
["[狗]", "https://bd.a.yximgs.com/bs2/emotion/1704761371094third_party_s1296649726.png"],
|
|
663
|
+
["[网红猫]", "https://ali2.a.yximgs.com/bs2/emotion/1704761307262third_party_s1296649487.png"],
|
|
664
|
+
["[猫]", "https://ali2.a.yximgs.com/bs2/emotion/1704761245827third_party_s1296649373.png"],
|
|
665
|
+
["[老鼠]", "https://ali2.a.yximgs.com/bs2/emotion/1704761189331third_party_s1296649156.png"],
|
|
666
|
+
["[不看]", "https://ali2.a.yximgs.com/bs2/emotion/1704761136865third_party_s1296649061.png"],
|
|
667
|
+
["[不听]", "https://ali2.a.yximgs.com/bs2/emotion/1704761074831third_party_s1296648807.png"],
|
|
668
|
+
["[不说]", "https://ali2.a.yximgs.com/bs2/emotion/1704761014678third_party_s1296648623.png"],
|
|
669
|
+
["[猪头]", "https://ali2.a.yximgs.com/bs2/emotion/1704760952536third_party_s1296648309.png"],
|
|
670
|
+
["[猪鼻子]", "https://ali2.a.yximgs.com/bs2/emotion/1704760884297third_party_s1296648188.png"],
|
|
671
|
+
["[猪蹄]", "https://ali2.a.yximgs.com/bs2/emotion/1704760771304third_party_s1296648058.png"],
|
|
672
|
+
["[羊驼]", "https://ali2.a.yximgs.com/bs2/emotion/1704760711037third_party_s1296647965.png"],
|
|
673
|
+
["[麦克风]", "https://ali2.a.yximgs.com/bs2/emotion/1704760647218third_party_s1296647852.png"],
|
|
674
|
+
["[跳舞]", "https://ali2.a.yximgs.com/bs2/emotion/1704760582888third_party_s1296647756.png"],
|
|
675
|
+
["[蛋糕]", "https://bd.a.yximgs.com/bs2/emotion/1704760405763third_party_s1296647250.png"],
|
|
676
|
+
["[口红]", "https://ali2.a.yximgs.com/bs2/emotion/1704760472494third_party_s1296647403.png"],
|
|
677
|
+
["[水枪]", "https://ali2.a.yximgs.com/bs2/emotion/1704760254873third_party_s1296646780.png"],
|
|
678
|
+
["[空投]", "https://bd.a.yximgs.com/bs2/emotion/1704760193986third_party_s1296646575.png"],
|
|
679
|
+
["[手柄]", "https://ali2.a.yximgs.com/bs2/emotion/1704760091452third_party_s1296646374.png"],
|
|
680
|
+
["[坑]", "https://ali2.a.yximgs.com/bs2/emotion/1704759985787third_party_s1296646211.png"],
|
|
681
|
+
["[八倍镜]", "https://ali2.a.yximgs.com/bs2/emotion/1704759889785third_party_s1296646065.png"],
|
|
682
|
+
["[网红]", "https://bd.a.yximgs.com/bs2/emotion/1704759766583third_party_s1296645553.png"],
|
|
683
|
+
["[优秀]", "https://ali2.a.yximgs.com/bs2/emotion/1704759660137third_party_s1296645301.png"],
|
|
684
|
+
["[减1]", "https://ali2.a.yximgs.com/bs2/emotion/1704720665766third_party_s1296409266.png"],
|
|
685
|
+
["[必胜]", "https://bd.a.yximgs.com/bs2/emotion/1704759542034third_party_s1296644941.png"],
|
|
686
|
+
["[戴口罩]", "https://ali2.a.yximgs.com/bs2/emotion/1704704107430third_party_s1295984389.png"],
|
|
687
|
+
["[勤洗手]", "https://ali2.a.yximgs.com/bs2/emotion/1704703259238third_party_s1295977084.png"],
|
|
688
|
+
["[心心]", "https://ali2.a.yximgs.com/bs2/emotion/1704772346276third_party_s1296705763.png"],
|
|
689
|
+
["[哭笑]", "https://ali2.a.yximgs.com/bs2/emotion/1704702678707third_party_s1295972366.png"],
|
|
690
|
+
["[点赞]", "https://ali2.a.yximgs.com/bs2/emotion/1704701773745third_party_s1295965382.png"],
|
|
691
|
+
["[菜刀]", "https://ali2.a.yximgs.com/bs2/emotion/1704762819173third_party_s1296655522.png"],
|
|
692
|
+
["[扎心]", "https://ali2.a.yximgs.com/bs2/emotion/1704763391921third_party_s1296657345.png"],
|
|
693
|
+
["[拍一拍]", "https://ali2.a.yximgs.com/bs2/emotion/1704699252327third_party_s1295948859.png"],
|
|
694
|
+
["[稳]", "https://ali2.a.yximgs.com/bs2/emotion/1704780742645third_party_s1296794020.png"],
|
|
695
|
+
["[收到]", "https://ali2.a.yximgs.com/bs2/emotion/1704782800053third_party_s1296805478.png"],
|
|
696
|
+
["[加1]", "https://bd.a.yximgs.com/bs2/emotion/1704782930366third_party_s1296806744.png"],
|
|
697
|
+
["[叉号]", "https://ali2.a.yximgs.com/bs2/emotion/1704782991766third_party_s1296807145.png"],
|
|
698
|
+
["[对号]", "https://ali2.a.yximgs.com/bs2/emotion/1704783055649third_party_s1296807447.png"],
|
|
699
|
+
["[no]", "https://ali2.a.yximgs.com/bs2/emotion/1704783096203third_party_s1296807744.png"],
|
|
700
|
+
["[yes]", "https://ali2.a.yximgs.com/bs2/emotion/1704783149616third_party_s1296808385.png"],
|
|
701
|
+
["[湿巾]", "https://ali2.a.yximgs.com/bs2/emotion/1704783721396third_party_s1296812504.png"],
|
|
702
|
+
["[吃饭]", "https://ali2.a.yximgs.com/bs2/emotion/1704783768169third_party_s1296812801.png"],
|
|
703
|
+
["[莫吉托]", "https://ali2.a.yximgs.com/bs2/emotion/1704783816852third_party_s1296812989.png"],
|
|
704
|
+
["[香草蛋糕]", "https://ali2.a.yximgs.com/bs2/emotion/1704783879438third_party_s1296813277.png"],
|
|
705
|
+
["[健身]", "https://ali2.a.yximgs.com/bs2/emotion/1704783968269third_party_s1296813760.png"],
|
|
706
|
+
["[思考]", "https://ali2.a.yximgs.com/bs2/emotion/1704784017068third_party_s1296813974.png"],
|
|
707
|
+
["[疯狂工作]", "https://bd.a.yximgs.com/bs2/emotion/1704784063813third_party_s1296814234.png"],
|
|
708
|
+
["[充满干劲]", "https://ali2.a.yximgs.com/bs2/emotion/1704785056742third_party_s1296820406.png"],
|
|
709
|
+
["[放轻松]", "https://ali2.a.yximgs.com/bs2/emotion/1704785103740third_party_s1296820865.png"],
|
|
710
|
+
["[卷]", "https://ali2.a.yximgs.com/bs2/emotion/1704786813813third_party_s1296831667.png"],
|
|
711
|
+
["[熬夜]", "https://ali2.a.yximgs.com/bs2/emotion/1704786853592third_party_s1296831948.png"],
|
|
712
|
+
["[先睡了]", "https://ali2.a.yximgs.com/bs2/emotion/1704786910336third_party_s1296832209.png"],
|
|
713
|
+
["[emo]", "https://ali2.a.yximgs.com/bs2/emotion/1704786943774third_party_s1296832458.png"],
|
|
714
|
+
["[听音乐]", "https://bd.a.yximgs.com/bs2/emotion/1704786984951third_party_s1296832685.png"],
|
|
715
|
+
["[好运来]", "https://ali2.a.yximgs.com/bs2/emotion/1704787279186third_party_s1296834761.png"],
|
|
716
|
+
["[元气满满]", "https://ali2.a.yximgs.com/bs2/emotion/1704787606436third_party_s1296836908.png"],
|
|
717
|
+
["[学习]", "https://ali2.a.yximgs.com/bs2/emotion/1704787673918third_party_s1296837372.png"],
|
|
718
|
+
["[打电话]", "https://ali2.a.yximgs.com/bs2/emotion/1704787717756third_party_s1296837621.png"],
|
|
719
|
+
["[熬夜工作]", "https://ali2.a.yximgs.com/bs2/emotion/1704787761789third_party_s1296837795.png"],
|
|
720
|
+
["[一起嗨皮]", "https://ali2.a.yximgs.com/bs2/emotion/1704787815614third_party_s1296838146.png"],
|
|
721
|
+
["[难受]", "https://ali2.a.yximgs.com/bs2/emotion/1704787901952third_party_s1296838607.png"],
|
|
722
|
+
["[上吊]", "https://ali2.a.yximgs.com/bs2/emotion/1704787935223third_party_s1296838745.png"],
|
|
723
|
+
["[吓]", "https://ali2.a.yximgs.com/bs2/emotion/1704787981957third_party_s1296839028.png"],
|
|
724
|
+
["[发呆]", "https://bd.a.yximgs.com/bs2/emotion/1704788025440third_party_s1296839215.png"],
|
|
725
|
+
["[疲惫]", "https://ali2.a.yximgs.com/bs2/emotion/1704788904736third_party_s1296845175.png"],
|
|
726
|
+
["[裂开]", "https://ali2.a.yximgs.com/bs2/emotion/1704788951325third_party_s1296845410.png"],
|
|
727
|
+
["[强颜欢笑]", "https://ali2.a.yximgs.com/bs2/emotion/1704788997306third_party_s1296845817.png"],
|
|
728
|
+
["[翻白眼]", "https://ali2.a.yximgs.com/bs2/emotion/1704789037112third_party_s1296846026.png"],
|
|
729
|
+
["[难过至极]", "https://ali2.a.yximgs.com/bs2/emotion/1704789078980third_party_s1296846236.png"],
|
|
730
|
+
["[美滋滋]", "https://ali2.a.yximgs.com/bs2/emotion/1704789133176third_party_s1296846710.png"],
|
|
731
|
+
["[马上安排]", "https://ali2.a.yximgs.com/bs2/emotion/1704789177867third_party_s1296847087.png"],
|
|
732
|
+
["[摸鱼]", "https://ali2.a.yximgs.com/bs2/emotion/1704789217352third_party_s1296847412.png"],
|
|
733
|
+
["[敬礼]", "https://ali2.a.yximgs.com/bs2/emotion/1704789256009third_party_s1296847689.png"],
|
|
734
|
+
["[求求了]", "https://ali2.a.yximgs.com/bs2/emotion/1704789289580third_party_s1296847957.png"],
|
|
735
|
+
["[赢麻了]", "https://ali2.a.yximgs.com/bs2/emotion/1704789337176third_party_s1296848206.png"],
|
|
736
|
+
["[遥遥领先]", "https://ali2.a.yximgs.com/bs2/emotion/1704789382578third_party_s1296848447.png"],
|
|
737
|
+
["[辣眼睛]", "https://ali2.a.yximgs.com/bs2/emotion/1704789443283third_party_s1296848822.png"],
|
|
738
|
+
["[ok]", "https://ali2.a.yximgs.com/bs2/emotion/1704789999083third_party_s1296852648.png"],
|
|
739
|
+
["[握手]", "https://ali2.a.yximgs.com/bs2/emotion/1704790046552third_party_s1296852850.png"],
|
|
740
|
+
["[抱拳]", "https://bd.a.yximgs.com/bs2/emotion/1704790113221third_party_s1296853443.png"],
|
|
741
|
+
["[早上好]", "https://ali2.a.yximgs.com/bs2/emotion/1704790167344third_party_s1296853922.png"],
|
|
742
|
+
["[胡思乱想]", "https://ali2.a.yximgs.com/bs2/emotion/1704790657229third_party_s1296858542.png"]
|
|
743
|
+
], d = class d {
|
|
536
744
|
constructor(t) {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
745
|
+
r(this, "rawType");
|
|
746
|
+
r(this, "rawContent");
|
|
747
|
+
r(this, "_cachedValues", {});
|
|
540
748
|
this.rawType = t.type;
|
|
541
749
|
try {
|
|
542
750
|
typeof t.content == "string" ? this.rawContent = JSON.parse(t.content) : this.rawContent = t.content;
|
|
543
751
|
} catch {
|
|
544
752
|
this.rawContent = t.content;
|
|
545
753
|
}
|
|
546
|
-
const
|
|
547
|
-
Object.getOwnPropertyNames(
|
|
548
|
-
const n = Object.getOwnPropertyDescriptor(
|
|
549
|
-
n && typeof n.get == "function" && Object.defineProperty(
|
|
754
|
+
const i = this, s = Object.getPrototypeOf(this);
|
|
755
|
+
Object.getOwnPropertyNames(s).forEach((e) => {
|
|
756
|
+
const n = Object.getOwnPropertyDescriptor(s, e);
|
|
757
|
+
n && typeof n.get == "function" && Object.defineProperty(i, e, {
|
|
550
758
|
get: function() {
|
|
551
|
-
return
|
|
552
|
-
var
|
|
553
|
-
return (
|
|
759
|
+
return i.getCachedValue(e, () => {
|
|
760
|
+
var p;
|
|
761
|
+
return (p = n.get) == null ? void 0 : p.call(i);
|
|
554
762
|
});
|
|
555
763
|
},
|
|
556
764
|
enumerable: !0,
|
|
@@ -558,8 +766,8 @@ const C = [
|
|
|
558
766
|
});
|
|
559
767
|
});
|
|
560
768
|
}
|
|
561
|
-
getCachedValue(t,
|
|
562
|
-
return this._cachedValues[t] || (this._cachedValues[t] =
|
|
769
|
+
getCachedValue(t, i) {
|
|
770
|
+
return this._cachedValues[t] || (this._cachedValues[t] = i()), this._cachedValues[t];
|
|
563
771
|
}
|
|
564
772
|
/**
|
|
565
773
|
* The live platform to which the message belongs.
|
|
@@ -567,12 +775,14 @@ const C = [
|
|
|
567
775
|
* @see {@link https://dimsum.chat/zh/api/parser.html#parser-platform}
|
|
568
776
|
*/
|
|
569
777
|
get platform() {
|
|
570
|
-
const t = /^Webcast[A-Z][a-zA-Z]*Message$/,
|
|
778
|
+
const t = /^Webcast[A-Z][a-zA-Z]*Message$/, i = /^(Common|Acfun)(Action|State)Signal[A-Z][a-zA-Z]*/;
|
|
571
779
|
if ("cmd" in this.rawContent && typeof this.rawContent.cmd == "string")
|
|
572
780
|
return this.rawContent.cmd.includes("LIVE_OPEN_PLATFORM") ? "openblive" : "bilibili";
|
|
573
781
|
if (t.test(this.rawType))
|
|
574
782
|
return "douyin";
|
|
575
|
-
if (
|
|
783
|
+
if (this.rawType.startsWith("Kuaishou"))
|
|
784
|
+
return "kuaishou";
|
|
785
|
+
if (i.test(this.rawType))
|
|
576
786
|
return "acfun";
|
|
577
787
|
}
|
|
578
788
|
/**
|
|
@@ -587,13 +797,15 @@ const C = [
|
|
|
587
797
|
"LIVE_OPEN_PLATFORM_DM",
|
|
588
798
|
"CommonActionSignalComment",
|
|
589
799
|
"WebcastChatMessage",
|
|
590
|
-
"DANMU_MSG"
|
|
800
|
+
"DANMU_MSG",
|
|
801
|
+
"KuaishouCommentFeeds"
|
|
591
802
|
],
|
|
592
803
|
gift: [
|
|
593
804
|
"LIVE_OPEN_PLATFORM_SEND_GIFT",
|
|
594
805
|
"CommonActionSignalGift",
|
|
595
806
|
"WebcastGiftMessage",
|
|
596
|
-
"SEND_GIFT"
|
|
807
|
+
"SEND_GIFT",
|
|
808
|
+
"KuaishouGiftFeeds"
|
|
597
809
|
],
|
|
598
810
|
follow: [
|
|
599
811
|
"CommonActionSignalUserFollowAuthor"
|
|
@@ -606,7 +818,8 @@ const C = [
|
|
|
606
818
|
"LIVE_OPEN_PLATFORM_LIKE",
|
|
607
819
|
"CommonActionSignalLike",
|
|
608
820
|
"WebcastLikeMessage",
|
|
609
|
-
"LIKE_INFO_V3_CLICK"
|
|
821
|
+
"LIKE_INFO_V3_CLICK",
|
|
822
|
+
"KuaishouLikeFeeds"
|
|
610
823
|
],
|
|
611
824
|
guard: [
|
|
612
825
|
"LIVE_OPEN_PLATFORM_GUARD",
|
|
@@ -620,12 +833,14 @@ const C = [
|
|
|
620
833
|
"CommonActionSignalUserEnterRoom",
|
|
621
834
|
"WebcastMemberMessage"
|
|
622
835
|
],
|
|
623
|
-
share: [
|
|
836
|
+
share: [
|
|
837
|
+
"KuaishouShareFeeds"
|
|
838
|
+
]
|
|
624
839
|
};
|
|
625
840
|
if (!(this.rawType === "WebcastGiftMessage" && this.rawContent.repeatEnd === 1)) {
|
|
626
|
-
for (let
|
|
627
|
-
if (t[
|
|
628
|
-
return
|
|
841
|
+
for (let i in t)
|
|
842
|
+
if (t[i].includes(this.rawType))
|
|
843
|
+
return i;
|
|
629
844
|
if (this.rawType === "INTERACT_WORD")
|
|
630
845
|
return [void 0, "enter", "follow", "share", "follow", "follow", "like"][this.rawContent.data.msg_type];
|
|
631
846
|
if (this.rawType === "WebcastSocialMessage") {
|
|
@@ -662,6 +877,8 @@ const C = [
|
|
|
662
877
|
}
|
|
663
878
|
if (this.platform === "douyin" && "user" in this.rawContent)
|
|
664
879
|
return this.rawContent.user.nickName;
|
|
880
|
+
if (this.platform === "kuaishou" && "user" in this.rawContent)
|
|
881
|
+
return this.rawContent.user.userName;
|
|
665
882
|
}
|
|
666
883
|
/**
|
|
667
884
|
* User ID.
|
|
@@ -687,6 +904,8 @@ const C = [
|
|
|
687
904
|
}
|
|
688
905
|
if (this.platform === "douyin" && "user" in this.rawContent)
|
|
689
906
|
return this.rawContent.user.id;
|
|
907
|
+
if (this.platform === "kuaishou" && "user" in this.rawContent)
|
|
908
|
+
return this.rawContent.user.principalId;
|
|
690
909
|
}
|
|
691
910
|
get clubLevel() {
|
|
692
911
|
if (this.platform === "bilibili" || this.platform === "openblive") {
|
|
@@ -770,13 +989,16 @@ const C = [
|
|
|
770
989
|
}
|
|
771
990
|
if (this.platform === "douyin" && "user" in this.rawContent)
|
|
772
991
|
return this.rawContent.user.avatarThumb.urlListList[0];
|
|
992
|
+
if (this.platform === "kuaishou" && "user" in this.rawContent && "headUrl" in this.rawContent.user && this.rawContent.user.headUrl)
|
|
993
|
+
return this.rawContent.user.headUrl;
|
|
773
994
|
}
|
|
774
995
|
get comment() {
|
|
775
996
|
const t = {
|
|
776
997
|
acfun: () => this.rawContent.content,
|
|
777
998
|
bilibili: () => this.rawContent.info[1],
|
|
778
999
|
openblive: () => this.rawContent.data.msg,
|
|
779
|
-
douyin: () => this.rawContent.content
|
|
1000
|
+
douyin: () => this.rawContent.content,
|
|
1001
|
+
kuaishou: () => this.rawContent.content
|
|
780
1002
|
};
|
|
781
1003
|
return this.type === "comment" && t[this.platform] ? t[this.platform]() : this.type === "superchat" ? this.superChatComment : void 0;
|
|
782
1004
|
}
|
|
@@ -789,53 +1011,63 @@ const C = [
|
|
|
789
1011
|
*/
|
|
790
1012
|
getCommentHTML(t = {}) {
|
|
791
1013
|
const {
|
|
792
|
-
stickerStyle:
|
|
793
|
-
stickerClass:
|
|
794
|
-
emotStyle:
|
|
1014
|
+
stickerStyle: i = "",
|
|
1015
|
+
stickerClass: s = "",
|
|
1016
|
+
emotStyle: e = "",
|
|
795
1017
|
emotClass: n = "",
|
|
796
|
-
acfunCustomStickers:
|
|
797
|
-
acfunCustomHtmlBuilder:
|
|
798
|
-
} = t,
|
|
1018
|
+
acfunCustomStickers: p = [],
|
|
1019
|
+
acfunCustomHtmlBuilder: g
|
|
1020
|
+
} = t, f = {
|
|
799
1021
|
acfun: () => {
|
|
800
|
-
let
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
1022
|
+
let o = h(this.rawContent.content);
|
|
1023
|
+
if ("emotionUrl" in this.rawContent && this.rawContent.emotionUrl)
|
|
1024
|
+
return `<img src="${this.rawContent.emotionUrl}" alt="" style="${i}" class="${s}">`;
|
|
1025
|
+
let c;
|
|
1026
|
+
return p.forEach((b) => {
|
|
1027
|
+
o.includes(b.keyWord) && (c = b.path);
|
|
1028
|
+
}), c != null ? g != null ? g(c, o) : `<div style="display:flex;">
|
|
1029
|
+
<img src="${c}" alt="" style="${i}" class="${s}">
|
|
1030
|
+
<div style="flex-grow:1;">${o}</div>
|
|
1031
|
+
</div>` : h(this.rawContent.content);
|
|
807
1032
|
},
|
|
808
1033
|
bilibili: () => {
|
|
809
1034
|
if (typeof this.rawContent.info[0][13] == "object")
|
|
810
|
-
return `<img src="${this.rawContent.info[0][13].url}" alt="" style="${
|
|
811
|
-
const
|
|
812
|
-
let
|
|
813
|
-
const
|
|
814
|
-
for (let
|
|
815
|
-
const F = new RegExp(`\\${
|
|
816
|
-
|
|
1035
|
+
return `<img src="${this.rawContent.info[0][13].url}" alt="" style="${i}" class="${s}">`;
|
|
1036
|
+
const o = this.rawContent.info[0][15].extra, c = JSON.parse(o);
|
|
1037
|
+
let b = h(c.content);
|
|
1038
|
+
const v = c.emots;
|
|
1039
|
+
for (let u in v) {
|
|
1040
|
+
const F = new RegExp(`\\${u}`, "g");
|
|
1041
|
+
b = b.replace(F, `<img src="${v[u].url}" alt="" style="${e}" class="${n}">`);
|
|
817
1042
|
}
|
|
818
|
-
return
|
|
1043
|
+
return b;
|
|
819
1044
|
},
|
|
820
1045
|
openblive: () => {
|
|
821
1046
|
if (this.rawContent.data.emoji_img_url)
|
|
822
|
-
return `<img src="${this.rawContent.data.emoji_img_url}" alt="" style="${
|
|
823
|
-
let
|
|
824
|
-
return
|
|
825
|
-
const
|
|
826
|
-
|
|
827
|
-
}),
|
|
1047
|
+
return `<img src="${this.rawContent.data.emoji_img_url}" alt="" style="${i}" class="${s}">`;
|
|
1048
|
+
let o = h(this.rawContent.data.msg);
|
|
1049
|
+
return C.forEach((c) => {
|
|
1050
|
+
const b = new RegExp(`\\${c[0]}`, "g");
|
|
1051
|
+
o = o.replace(b, `<img src="${c[1]}" alt="" style="${e}" class="${n}">`);
|
|
1052
|
+
}), o;
|
|
828
1053
|
},
|
|
829
1054
|
douyin: () => {
|
|
830
|
-
let
|
|
831
|
-
return
|
|
832
|
-
const
|
|
833
|
-
|
|
834
|
-
}),
|
|
1055
|
+
let o = h(this.rawContent.content);
|
|
1056
|
+
return z.forEach((c) => {
|
|
1057
|
+
const b = new RegExp(`\\${c[0]}`, "g");
|
|
1058
|
+
o = o.replace(b, `<img src="${c[1]}" alt="" style="${e}" class="${n}">`);
|
|
1059
|
+
}), o;
|
|
1060
|
+
},
|
|
1061
|
+
kuaishou: () => {
|
|
1062
|
+
let o = h(this.rawContent.content);
|
|
1063
|
+
return w.forEach((c) => {
|
|
1064
|
+
const b = new RegExp(`\\${c[0]}`, "g");
|
|
1065
|
+
o = o.replace(b, `<img src="${c[1]}" alt="" style="${e}" class="${n}">`);
|
|
1066
|
+
}), o;
|
|
835
1067
|
}
|
|
836
1068
|
};
|
|
837
|
-
if (this.type === "comment" &&
|
|
838
|
-
return
|
|
1069
|
+
if (this.type === "comment" && f[this.platform])
|
|
1070
|
+
return f[this.platform]();
|
|
839
1071
|
}
|
|
840
1072
|
/**
|
|
841
1073
|
* Custom comment content builder.
|
|
@@ -845,32 +1077,36 @@ const C = [
|
|
|
845
1077
|
* @see {@link https://dimsum.chat/zh/api/parser.html#parser-commentbuilder}
|
|
846
1078
|
*/
|
|
847
1079
|
CommentBuilder(t) {
|
|
848
|
-
const
|
|
1080
|
+
const i = {
|
|
849
1081
|
acfun: () => {
|
|
850
|
-
let
|
|
851
|
-
return t(
|
|
1082
|
+
let s = h(this.rawContent.content), e = "emotionUrl" in this.rawContent && this.rawContent.emotionUrl ? this.rawContent.emotionUrl : void 0;
|
|
1083
|
+
return t(s, e);
|
|
852
1084
|
},
|
|
853
1085
|
bilibili: () => {
|
|
854
|
-
let
|
|
855
|
-
typeof this.rawContent.info[0][13] == "object" && (
|
|
856
|
-
const n = this.rawContent.info[0][15].extra,
|
|
857
|
-
for (let
|
|
858
|
-
|
|
859
|
-
return t(
|
|
1086
|
+
let s, e = [];
|
|
1087
|
+
typeof this.rawContent.info[0][13] == "object" && (s = this.rawContent.info[0][13].url);
|
|
1088
|
+
const n = this.rawContent.info[0][15].extra, p = JSON.parse(n), g = h(p.content), f = p.emots;
|
|
1089
|
+
for (let o in f)
|
|
1090
|
+
e.push([o, f[o].url]);
|
|
1091
|
+
return t(g, s, e);
|
|
860
1092
|
},
|
|
861
1093
|
openblive: () => {
|
|
862
|
-
let
|
|
863
|
-
this.rawContent.data.emoji_img_url && (
|
|
864
|
-
const
|
|
865
|
-
return t(
|
|
1094
|
+
let s;
|
|
1095
|
+
this.rawContent.data.emoji_img_url && (s = this.rawContent.data.emoji_img_url);
|
|
1096
|
+
const e = h(this.rawContent.data.msg);
|
|
1097
|
+
return t(e, s, C);
|
|
866
1098
|
},
|
|
867
1099
|
douyin: () => {
|
|
868
|
-
const
|
|
869
|
-
return t(
|
|
1100
|
+
const s = h(this.rawContent.content);
|
|
1101
|
+
return t(s, void 0, z);
|
|
1102
|
+
},
|
|
1103
|
+
kuaishou: () => {
|
|
1104
|
+
const s = h(this.rawContent.content);
|
|
1105
|
+
return t(s, void 0, w);
|
|
870
1106
|
}
|
|
871
1107
|
};
|
|
872
|
-
if (this.type === "comment" &&
|
|
873
|
-
return
|
|
1108
|
+
if (this.type === "comment" && i[this.platform])
|
|
1109
|
+
return i[this.platform]();
|
|
874
1110
|
}
|
|
875
1111
|
/**
|
|
876
1112
|
* 大航海等级:0-无 3-舰长 2-提督 1-总督
|
|
@@ -906,7 +1142,8 @@ const C = [
|
|
|
906
1142
|
acfun: () => this.rawContent.giftInfo.name,
|
|
907
1143
|
bilibili: () => this.rawContent.data.giftName,
|
|
908
1144
|
openblive: () => this.rawContent.data.gift_name,
|
|
909
|
-
douyin: () => this.rawContent.gift.name
|
|
1145
|
+
douyin: () => this.rawContent.gift.name,
|
|
1146
|
+
kuaishou: () => this.rawContent.giftInfo.name
|
|
910
1147
|
};
|
|
911
1148
|
if (this.type === "gift" && t[this.platform])
|
|
912
1149
|
return t[this.platform]();
|
|
@@ -918,11 +1155,16 @@ const C = [
|
|
|
918
1155
|
openblive: () => this.rawContent.data.gift_num,
|
|
919
1156
|
douyin: () => {
|
|
920
1157
|
if (this.rawContent.sendType === 4) {
|
|
921
|
-
const
|
|
922
|
-
let
|
|
923
|
-
return
|
|
1158
|
+
const s = this.rawContent.comboCount, e = this.rawContent.groupId, n = this.rawContent.giftId, p = this.uid, g = `${e}_${p}_${n}`;
|
|
1159
|
+
let f = 0;
|
|
1160
|
+
return d.douyinGiftGroup.has(g) && (f = d.douyinGiftGroup.get(g) ?? 0), d.douyinGiftGroup.set(g, s), d.douyinGiftGroup.size > 1024 && d.douyinGiftGroup.delete(d.douyinGiftGroup.keys().next().value ?? ""), s - f;
|
|
924
1161
|
}
|
|
925
1162
|
return this.rawContent.groupCount;
|
|
1163
|
+
},
|
|
1164
|
+
kuaishou: () => {
|
|
1165
|
+
const s = this.rawContent.batchSize * this.rawContent.comboCount, e = this.rawContent.mergeKey;
|
|
1166
|
+
let n = 0;
|
|
1167
|
+
return d.kuaishouGiftGroup.has(e) && (n = d.kuaishouGiftGroup.get(e) ?? 0), d.kuaishouGiftGroup.set(e, s), d.kuaishouGiftGroup.size > 1024 && d.kuaishouGiftGroup.delete(d.kuaishouGiftGroup.keys().next().value ?? ""), s - n;
|
|
926
1168
|
}
|
|
927
1169
|
};
|
|
928
1170
|
if (this.type === "gift" && t[this.platform])
|
|
@@ -933,7 +1175,8 @@ const C = [
|
|
|
933
1175
|
acfun: () => this.rawContent.gift.giftId !== 1 ? this.rawContent.giftInfo.value / 10 : 0,
|
|
934
1176
|
bilibili: () => this.rawContent.data.coin_type !== "silver" ? this.rawContent.data.price / 1e3 : 0,
|
|
935
1177
|
openblive: () => this.rawContent.data.paid ? this.rawContent.data.price / 1e3 : 0,
|
|
936
|
-
douyin: () => this.rawContent.gift.diamondCount / 10
|
|
1178
|
+
douyin: () => this.rawContent.gift.diamondCount / 10,
|
|
1179
|
+
kuaishou: () => this.rawContent.giftInfo.unitPrice / 10
|
|
937
1180
|
};
|
|
938
1181
|
if (this.type === "gift" && t[this.platform])
|
|
939
1182
|
return t[this.platform]();
|
|
@@ -968,29 +1211,31 @@ const C = [
|
|
|
968
1211
|
}
|
|
969
1212
|
getAbstractLevel(t = {}) {
|
|
970
1213
|
const {
|
|
971
|
-
douyinSteps:
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
1214
|
+
douyinSteps: i = [7, 11, 15],
|
|
1215
|
+
kuaishouSteps: s = [7, 11, 15],
|
|
1216
|
+
acfunSteps: e = [7, 11, 15],
|
|
1217
|
+
acfunClubUid: n = 0
|
|
1218
|
+
} = t, p = (o) => {
|
|
975
1219
|
if (this.clubLevel === void 0)
|
|
976
1220
|
return 0;
|
|
977
|
-
const
|
|
978
|
-
return
|
|
979
|
-
},
|
|
980
|
-
douyin: () =>
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
1221
|
+
const c = o.findIndex((b) => this.clubLevel <= b);
|
|
1222
|
+
return c !== -1 ? c : o.length;
|
|
1223
|
+
}, g = () => this.guardLevel && this.guardLevel > 0 ? 4 - this.guardLevel : 0, f = {
|
|
1224
|
+
douyin: () => p(i),
|
|
1225
|
+
kuaishou: () => p(s),
|
|
1226
|
+
acfun: () => n > 0 && this.acfunClubUid !== n ? 0 : p(e),
|
|
1227
|
+
bilibili: () => g(),
|
|
1228
|
+
openblive: () => g()
|
|
984
1229
|
};
|
|
985
|
-
if (
|
|
986
|
-
return
|
|
1230
|
+
if (f[this.platform])
|
|
1231
|
+
return f[this.platform]();
|
|
987
1232
|
}
|
|
988
1233
|
};
|
|
989
1234
|
// groupId_userId_giftId : comboCount
|
|
990
|
-
d
|
|
991
|
-
let
|
|
992
|
-
function
|
|
993
|
-
return
|
|
1235
|
+
r(d, "douyinGiftGroup", /* @__PURE__ */ new Map()), r(d, "kuaishouGiftGroup", /* @__PURE__ */ new Map());
|
|
1236
|
+
let j = d;
|
|
1237
|
+
function h(a) {
|
|
1238
|
+
return a.replace(/[&<>"']/g, function(t) {
|
|
994
1239
|
switch (t) {
|
|
995
1240
|
case "&":
|
|
996
1241
|
return "&";
|
|
@@ -1008,9 +1253,9 @@ function x(o) {
|
|
|
1008
1253
|
});
|
|
1009
1254
|
}
|
|
1010
1255
|
export {
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1256
|
+
j as Parser,
|
|
1257
|
+
l as WebSocketManager,
|
|
1258
|
+
U as getBfaceURL,
|
|
1259
|
+
S as getWebSocketURL,
|
|
1260
|
+
R as onMessage
|
|
1016
1261
|
};
|