@norbert_bodziony/bloub 0.3.0 → 0.6.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 +32 -5
- package/dist/package/assets/boule.webp +0 -0
- package/dist/package/assets/cloe-corps.webp +0 -0
- package/dist/package/assets/cloe-oeil0-x.webp +0 -0
- package/dist/package/assets/cloe-oeil0-y.webp +0 -0
- package/dist/package/assets/cloe-oeil1-x.webp +0 -0
- package/dist/package/assets/cloe-oeil1-y.webp +0 -0
- package/dist/package/assets/forme-capsule.webp +0 -0
- package/dist/package/assets/forme-carre.webp +0 -0
- package/dist/package/assets/forme-cercle.webp +0 -0
- package/dist/package/assets/forme-galet.webp +0 -0
- package/dist/package/assets/forme-goutte.webp +0 -0
- package/dist/package/assets/forme-hexagone.webp +0 -0
- package/dist/package/assets/forme-losange.webp +0 -0
- package/dist/package/assets/forme-nuage.webp +0 -0
- package/dist/package/assets/forme-pentagone.webp +0 -0
- package/dist/package/assets/forme-squircle.webp +0 -0
- package/dist/package/assets/forme-triangle.webp +0 -0
- package/dist/package/assets/fred-corps.webp +0 -0
- package/dist/package/assets/fred-oeil0-x.webp +0 -0
- package/dist/package/assets/fred-oeil0-y.webp +0 -0
- package/dist/package/assets/fred-oeil1-x.webp +0 -0
- package/dist/package/assets/fred-oeil1-y.webp +0 -0
- package/dist/package/assets/malu-corps.webp +0 -0
- package/dist/package/assets/malu-oeil0-x.webp +0 -0
- package/dist/package/assets/malu-oeil0-y.webp +0 -0
- package/dist/package/assets/malu-oeil1-x.webp +0 -0
- package/dist/package/assets/malu-oeil1-y.webp +0 -0
- package/dist/package/assets/nexo-corps.webp +0 -0
- package/dist/package/assets/nexo-oeil0-x.webp +0 -0
- package/dist/package/assets/nexo-oeil0-y.webp +0 -0
- package/dist/package/assets/nexo-oeil1-x.webp +0 -0
- package/dist/package/assets/nexo-oeil1-y.webp +0 -0
- package/dist/package/assets/vita-corps.webp +0 -0
- package/dist/package/assets/vita-oeil0-x.webp +0 -0
- package/dist/package/assets/vita-oeil0-y.webp +0 -0
- package/dist/package/assets/vita-oeil1-x.webp +0 -0
- package/dist/package/assets/vita-oeil1-y.webp +0 -0
- package/dist/package/assets/yoshi-corps.webp +0 -0
- package/dist/package/assets/yoshi-oeil0-x.webp +0 -0
- package/dist/package/assets/yoshi-oeil0-y.webp +0 -0
- package/dist/package/assets/yoshi-oeil1-x.webp +0 -0
- package/dist/package/assets/yoshi-oeil1-y.webp +0 -0
- package/dist/package/chunks/BloubBot-_XolrDe1.js +2226 -0
- package/dist/package/chunks/BloubBot-server-V9r0a_k-.js +1 -0
- package/dist/package/index.js +2 -2115
- package/dist/package/plush-server.js +1 -0
- package/dist/package/plush.js +1202 -0
- package/dist/package/server.js +1 -1
- package/dist/package/types/bot/engine.d.ts +57 -1
- package/dist/package/types/bot/skins.d.ts +1 -1
- package/dist/package/types/bot/states.d.ts +2 -0
- package/dist/package/types/components/BloubBot.d.ts +48 -1
- package/dist/package/types/index.d.ts +1 -1
- package/dist/package/types/plush/PlushBot.d.ts +64 -0
- package/dist/package/types/plush/assets.d.ts +1 -0
- package/dist/package/types/plush/body.d.ts +28 -0
- package/dist/package/types/plush/catalogue.d.ts +56 -0
- package/dist/package/types/plush/index.d.ts +5 -0
- package/dist/package/types/plush/layer.d.ts +36 -0
- package/dist/package/types/plush/motion.d.ts +236 -0
- package/dist/package/types/plush/slices.d.ts +49 -0
- package/dist/package/types/plush/tint.d.ts +27 -0
- package/dist/package/types/plush/transition.d.ts +33 -0
- package/dist/package/types/plush/warp.d.ts +10 -0
- package/package.json +13 -2
package/dist/package/index.js
CHANGED
|
@@ -1,2115 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/bot/math.ts
|
|
4
|
-
var y = Math.PI * 2, b = (e, t = 0, n = 1) => e < t ? t : e > n ? n : e, x = (e, t, n) => e + (t - e) * n, S = {
|
|
5
|
-
easeOutCubic: (e) => 1 - (1 - e) ** 3,
|
|
6
|
-
easeInOutCubic: (e) => e < .5 ? 4 * e ** 3 : 1 - (-2 * e + 2) ** 3 / 2,
|
|
7
|
-
easeOutQuint: (e) => 1 - (1 - e) ** 5
|
|
8
|
-
};
|
|
9
|
-
function C(e, t, n = 0) {
|
|
10
|
-
let r = e / t * y;
|
|
11
|
-
return .55 * Math.sin(r + n) + .3 * Math.sin(2 * r + n * 1.7 + 1.1) + .15 * Math.sin(3 * r + n * 2.3 + 2.4);
|
|
12
|
-
}
|
|
13
|
-
function w(e) {
|
|
14
|
-
let t = e >>> 0;
|
|
15
|
-
return () => {
|
|
16
|
-
t = t + 1831565813 >>> 0;
|
|
17
|
-
let e = Math.imul(t ^ t >>> 15, 1 | t);
|
|
18
|
-
return e = e + Math.imul(e ^ e >>> 7, 61 | e) ^ e, ((e ^ e >>> 14) >>> 0) / 4294967296;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
var T = (e) => Math.round(e * 100) / 100;
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/bot/decor.ts
|
|
24
|
-
function E(e, t = .55, n = .62) {
|
|
25
|
-
let r = (e % 360 + 360) % 360, i = (1 - Math.abs(2 * n - 1)) * t, a = i * (1 - Math.abs(r / 60 % 2 - 1)), o = n - i / 2, [s, c, l] = r < 60 ? [
|
|
26
|
-
i,
|
|
27
|
-
a,
|
|
28
|
-
0
|
|
29
|
-
] : r < 120 ? [
|
|
30
|
-
a,
|
|
31
|
-
i,
|
|
32
|
-
0
|
|
33
|
-
] : r < 180 ? [
|
|
34
|
-
0,
|
|
35
|
-
i,
|
|
36
|
-
a
|
|
37
|
-
] : r < 240 ? [
|
|
38
|
-
0,
|
|
39
|
-
a,
|
|
40
|
-
i
|
|
41
|
-
] : r < 300 ? [
|
|
42
|
-
a,
|
|
43
|
-
0,
|
|
44
|
-
i
|
|
45
|
-
] : [
|
|
46
|
-
i,
|
|
47
|
-
0,
|
|
48
|
-
a
|
|
49
|
-
], u = (e) => Math.round((e + o) * 255).toString(16).padStart(2, "0");
|
|
50
|
-
return `#${u(s)}${u(c)}${u(l)}`;
|
|
51
|
-
}
|
|
52
|
-
function ee(e, t, n, r, i = 1) {
|
|
53
|
-
let a = e.phase + t * e.speed * y, o = Math.cos(e.tilt), s = Math.sin(e.tilt), c = Math.sqrt(Math.max(0, 1 - e.k * e.k)), l = e.sweep * y, u = "", d = "", f = null;
|
|
54
|
-
for (let t = 0; t <= 64; t++) {
|
|
55
|
-
let r = a + t / 64 * l, i = Math.cos(r), p = Math.sin(r), m = e.a * (i * o + p * -s * e.k) + e.cx, h = e.a * (i * s + p * o * e.k) + e.cy, g = e.a * p * c < 0, _ = T(m * n), v = T(h * n), y = g === f ? "L" : "M";
|
|
56
|
-
g ? d += `${y}${_} ${v}` : u += `${y}${_} ${v}`, f = g;
|
|
57
|
-
}
|
|
58
|
-
let p = Math.cos(e.tilt) * e.a * n, m = Math.sin(e.tilt) * e.a * n;
|
|
59
|
-
return {
|
|
60
|
-
id: r,
|
|
61
|
-
front: u,
|
|
62
|
-
back: d,
|
|
63
|
-
width: e.width * n,
|
|
64
|
-
opacity: i,
|
|
65
|
-
grad: {
|
|
66
|
-
x1: T(e.cx * n - p),
|
|
67
|
-
y1: T(e.cy * n - m),
|
|
68
|
-
x2: T(e.cx * n + p),
|
|
69
|
-
y2: T(e.cy * n + m),
|
|
70
|
-
stops: [
|
|
71
|
-
E(e.hue),
|
|
72
|
-
E(e.hue + e.hueSpan * .5),
|
|
73
|
-
E(e.hue + e.hueSpan)
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
var D = w(659918), O = Array.from({ length: 6 }, (e, t) => ({
|
|
79
|
-
a: 1.3 + D() * .1,
|
|
80
|
-
k: .05 + D() * .4,
|
|
81
|
-
tilt: t / 6 * Math.PI + D() * .5,
|
|
82
|
-
speed: 3 + D() * .7,
|
|
83
|
-
phase: D() * y,
|
|
84
|
-
sweep: .6 + D() * .25,
|
|
85
|
-
hue: t * 360 / 6 + D() * 30,
|
|
86
|
-
hueSpan: 60 + D() * 60,
|
|
87
|
-
width: .05 + D() * .012,
|
|
88
|
-
cx: 0,
|
|
89
|
-
cy: .1
|
|
90
|
-
})), te = Array.from({ length: 4 }, (e, t) => ({
|
|
91
|
-
a: .78 + t * .2,
|
|
92
|
-
k: .05 + t * .02,
|
|
93
|
-
tilt: -.62 + t * .05,
|
|
94
|
-
speed: .3,
|
|
95
|
-
phase: .06 * t,
|
|
96
|
-
sweep: .4,
|
|
97
|
-
hue: 95 + t * 62,
|
|
98
|
-
hueSpan: 100,
|
|
99
|
-
width: .05,
|
|
100
|
-
cx: 0,
|
|
101
|
-
cy: -.12
|
|
102
|
-
})), k = [
|
|
103
|
-
-.557,
|
|
104
|
-
-.013,
|
|
105
|
-
.532
|
|
106
|
-
], ne = .165, re = 1.25, ie = w(48879), ae = Array.from({ length: 5 }, (e, t) => ({
|
|
107
|
-
birth: t * .2,
|
|
108
|
-
angle: ie() * y,
|
|
109
|
-
rho: .58 + ie() * .18
|
|
110
|
-
}));
|
|
111
|
-
function oe(e, t) {
|
|
112
|
-
let n = [];
|
|
113
|
-
for (let r of ae) {
|
|
114
|
-
let i = e - r.birth;
|
|
115
|
-
if (i < 0 || i > .62) continue;
|
|
116
|
-
let a = r.rho * .75 ** (i * 10), o = r.angle + i * 100 * Math.PI / 180;
|
|
117
|
-
n.push({
|
|
118
|
-
x: Math.cos(o) * a * t,
|
|
119
|
-
y: Math.sin(o) * a * t,
|
|
120
|
-
r: (.04 + .028 * b(i / .55)) * t,
|
|
121
|
-
depth: b(1 - a / .8),
|
|
122
|
-
opacity: b(i / .06) * b((.62 - i) / .08)
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
return n;
|
|
126
|
-
}
|
|
127
|
-
var se = w(49383), ce = Array.from({ length: 4 }, (e, t) => {
|
|
128
|
-
let n = t - 1.5;
|
|
129
|
-
return {
|
|
130
|
-
a: .85 * (1 + n * .03),
|
|
131
|
-
k: .15 / .85 * (1 + n * .16),
|
|
132
|
-
tilt: 34 * Math.PI / 180 + n * .035,
|
|
133
|
-
speed: 210 / 360,
|
|
134
|
-
phase: -t * .045 + se() * .012,
|
|
135
|
-
sweep: .34,
|
|
136
|
-
hue: t * 85 + se() * 20,
|
|
137
|
-
hueSpan: 80,
|
|
138
|
-
width: .095,
|
|
139
|
-
cx: 0,
|
|
140
|
-
cy: 0
|
|
141
|
-
};
|
|
142
|
-
}), A = .129, le = "#2496e8", j = 1.003, ue = .15, de = 1.14, fe = .054, M = 15.46, N = .186, pe = .412, P = {
|
|
143
|
-
yaw: 28.49,
|
|
144
|
-
pitch: 28.62,
|
|
145
|
-
roll: -13
|
|
146
|
-
}, F = (e) => e * Math.PI / 180;
|
|
147
|
-
function I(e, t, n) {
|
|
148
|
-
let r = Math.cos(n), i = Math.sin(n);
|
|
149
|
-
return [[
|
|
150
|
-
e[0] * r + t[0] * i,
|
|
151
|
-
e[1] * r + t[1] * i,
|
|
152
|
-
e[2] * r + t[2] * i
|
|
153
|
-
], [
|
|
154
|
-
t[0] * r - e[0] * i,
|
|
155
|
-
t[1] * r - e[1] * i,
|
|
156
|
-
t[2] * r - e[2] * i
|
|
157
|
-
]];
|
|
158
|
-
}
|
|
159
|
-
function L(e, t, n = M) {
|
|
160
|
-
let r = [
|
|
161
|
-
0,
|
|
162
|
-
0,
|
|
163
|
-
1
|
|
164
|
-
], i = [
|
|
165
|
-
1,
|
|
166
|
-
0,
|
|
167
|
-
0
|
|
168
|
-
], a = [
|
|
169
|
-
0,
|
|
170
|
-
1,
|
|
171
|
-
0
|
|
172
|
-
];
|
|
173
|
-
[r, i] = I(r, i, F(e.yaw)), [a, r] = I(a, r, F(e.pitch)), [i, a] = I(i, a, F(e.roll));
|
|
174
|
-
let o = (e) => {
|
|
175
|
-
let [o, s] = I(r, i, F(n * e));
|
|
176
|
-
return {
|
|
177
|
-
x: o[0] * t,
|
|
178
|
-
y: o[1] * t,
|
|
179
|
-
a: s[0],
|
|
180
|
-
b: s[1],
|
|
181
|
-
c: a[0],
|
|
182
|
-
d: a[1],
|
|
183
|
-
depth: o[2]
|
|
184
|
-
};
|
|
185
|
-
};
|
|
186
|
-
return [o(-1), o(1)];
|
|
187
|
-
}
|
|
188
|
-
var me = w(24301), he = (() => {
|
|
189
|
-
let e = [], t = 1.4;
|
|
190
|
-
for (; t < 900;) e.push(t), t += 1.9 + me() * 2.7, me() < .18 && (e.push(t), t += .24);
|
|
191
|
-
return e;
|
|
192
|
-
})(), R = .18;
|
|
193
|
-
function ge(e) {
|
|
194
|
-
for (let t = 0; t < he.length; t++) {
|
|
195
|
-
let n = he[t];
|
|
196
|
-
if (e < n) break;
|
|
197
|
-
let r = (e - n) / R;
|
|
198
|
-
if (r >= 0 && r <= 1) return r < .45 ? 1 - r / .45 : (r - .45) / .55;
|
|
199
|
-
}
|
|
200
|
-
return 1;
|
|
201
|
-
}
|
|
202
|
-
function _e(e, t = {}) {
|
|
203
|
-
let { wander: n = 1, blink: r = !0, float: i = !0 } = t;
|
|
204
|
-
return {
|
|
205
|
-
dYaw: (C(e, 11.3, .4) * 5.5 + C(e, 3.7, 2.1) * 1.6) * n,
|
|
206
|
-
dPitch: (C(e, 9.1, 1.3) * 4.2 + C(e, 4.3, .7) * 1.3) * n,
|
|
207
|
-
dRoll: C(e, 13.7, 3.2) * 2.2 * n,
|
|
208
|
-
lid: r ? ge(e) : 1,
|
|
209
|
-
driftX: i ? C(e, 7.9, 1.9) * .006 : 0,
|
|
210
|
-
driftY: i ? C(e, 5.3, .3) * .007 : 0,
|
|
211
|
-
breath: i ? 1 + Math.sin(e / 3.4 * Math.PI * 2) * .005 : 1
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
function ve(e) {
|
|
215
|
-
return .06 + .94 * b(e);
|
|
216
|
-
}
|
|
217
|
-
//#endregion
|
|
218
|
-
//#region src/bot/expressions.ts
|
|
219
|
-
var z = (e, t, n = 0, r = 1) => ({
|
|
220
|
-
w: e,
|
|
221
|
-
h: t,
|
|
222
|
-
tilt: n,
|
|
223
|
-
open: r
|
|
224
|
-
}), B = (e, t, n = 0, r = 1) => [z(e, t, n, r), z(e, t, -n, r)], ye = [
|
|
225
|
-
{
|
|
226
|
-
id: "neutre",
|
|
227
|
-
gaze: { ...P },
|
|
228
|
-
split: M,
|
|
229
|
-
eyes: [z(N, pe), z(N, pe)]
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
id: "attentif",
|
|
233
|
-
gaze: {
|
|
234
|
-
yaw: 4,
|
|
235
|
-
pitch: 5,
|
|
236
|
-
roll: -4
|
|
237
|
-
},
|
|
238
|
-
split: 16,
|
|
239
|
-
eyes: B(.21, .44)
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
id: "surpris",
|
|
243
|
-
gaze: {
|
|
244
|
-
yaw: 3,
|
|
245
|
-
pitch: -3,
|
|
246
|
-
roll: 0
|
|
247
|
-
},
|
|
248
|
-
split: 19,
|
|
249
|
-
eyes: B(.45, .47)
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
id: "excite",
|
|
253
|
-
gaze: {
|
|
254
|
-
yaw: 6,
|
|
255
|
-
pitch: -14,
|
|
256
|
-
roll: 0
|
|
257
|
-
},
|
|
258
|
-
split: 19.5,
|
|
259
|
-
eyes: B(.4, .56, -10)
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
id: "heureux",
|
|
263
|
-
gaze: {
|
|
264
|
-
yaw: 5,
|
|
265
|
-
pitch: 9,
|
|
266
|
-
roll: 0
|
|
267
|
-
},
|
|
268
|
-
split: 17,
|
|
269
|
-
eyes: B(.27, .17, 14)
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
id: "hilare",
|
|
273
|
-
gaze: {
|
|
274
|
-
yaw: 4,
|
|
275
|
-
pitch: 14,
|
|
276
|
-
roll: 0
|
|
277
|
-
},
|
|
278
|
-
split: 18,
|
|
279
|
-
eyes: B(.34, .13, 20)
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
id: "colere",
|
|
283
|
-
gaze: {
|
|
284
|
-
yaw: 3,
|
|
285
|
-
pitch: 7,
|
|
286
|
-
roll: 0
|
|
287
|
-
},
|
|
288
|
-
split: 17,
|
|
289
|
-
eyes: B(.34, .15, 30)
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
id: "triste",
|
|
293
|
-
gaze: {
|
|
294
|
-
yaw: 3,
|
|
295
|
-
pitch: -13,
|
|
296
|
-
roll: 0
|
|
297
|
-
},
|
|
298
|
-
split: 16,
|
|
299
|
-
eyes: B(.22, .4, -28)
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
id: "effraye",
|
|
303
|
-
gaze: {
|
|
304
|
-
yaw: 2,
|
|
305
|
-
pitch: -20,
|
|
306
|
-
roll: 0
|
|
307
|
-
},
|
|
308
|
-
split: 20.5,
|
|
309
|
-
eyes: B(.4, .6)
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
id: "mefiant",
|
|
313
|
-
gaze: {
|
|
314
|
-
yaw: 12,
|
|
315
|
-
pitch: 6,
|
|
316
|
-
roll: -6
|
|
317
|
-
},
|
|
318
|
-
split: 16,
|
|
319
|
-
eyes: [z(.21, .4), z(.22, .15)]
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
id: "confus",
|
|
323
|
-
gaze: {
|
|
324
|
-
yaw: -14,
|
|
325
|
-
pitch: 3,
|
|
326
|
-
roll: 8
|
|
327
|
-
},
|
|
328
|
-
split: 16.5,
|
|
329
|
-
eyes: [z(.2, .44, -18), z(.28, .17, 14)]
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
id: "curieux",
|
|
333
|
-
gaze: {
|
|
334
|
-
yaw: 16,
|
|
335
|
-
pitch: -9,
|
|
336
|
-
roll: -15
|
|
337
|
-
},
|
|
338
|
-
split: 16.5,
|
|
339
|
-
eyes: [z(.24, .46, -8), z(.2, .38, -8)]
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
id: "fier",
|
|
343
|
-
gaze: {
|
|
344
|
-
yaw: 5,
|
|
345
|
-
pitch: 17,
|
|
346
|
-
roll: 0
|
|
347
|
-
},
|
|
348
|
-
split: 17,
|
|
349
|
-
eyes: B(.3, .15, 18)
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
id: "timide",
|
|
353
|
-
gaze: {
|
|
354
|
-
yaw: -19,
|
|
355
|
-
pitch: -14,
|
|
356
|
-
roll: -7
|
|
357
|
-
},
|
|
358
|
-
split: 14,
|
|
359
|
-
eyes: B(.17, .3)
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
id: "blase",
|
|
363
|
-
gaze: {
|
|
364
|
-
yaw: -22,
|
|
365
|
-
pitch: 2,
|
|
366
|
-
roll: 0
|
|
367
|
-
},
|
|
368
|
-
split: 16,
|
|
369
|
-
eyes: B(.3, .12)
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
id: "somnolent",
|
|
373
|
-
gaze: {
|
|
374
|
-
yaw: 6,
|
|
375
|
-
pitch: -9,
|
|
376
|
-
roll: -3
|
|
377
|
-
},
|
|
378
|
-
split: 16,
|
|
379
|
-
eyes: B(.2, .42, 0, .42)
|
|
380
|
-
}
|
|
381
|
-
], be = new Map(ye.map((e) => [e.id, e])), xe = "neutre", Se = (e, t, n) => ({
|
|
382
|
-
w: x(e.w, t.w, n),
|
|
383
|
-
h: x(e.h, t.h, n),
|
|
384
|
-
tilt: x(e.tilt ?? 0, t.tilt ?? 0, n),
|
|
385
|
-
open: x(e.open, t.open, n)
|
|
386
|
-
});
|
|
387
|
-
function Ce(e, t, n) {
|
|
388
|
-
return {
|
|
389
|
-
id: t.id,
|
|
390
|
-
gaze: {
|
|
391
|
-
yaw: x(e.gaze.yaw, t.gaze.yaw, n),
|
|
392
|
-
pitch: x(e.gaze.pitch, t.gaze.pitch, n),
|
|
393
|
-
roll: x(e.gaze.roll, t.gaze.roll, n)
|
|
394
|
-
},
|
|
395
|
-
split: x(e.split, t.split, n),
|
|
396
|
-
eyes: [Se(e.eyes[0], t.eyes[0], n), Se(e.eyes[1], t.eyes[1], n)]
|
|
397
|
-
};
|
|
398
|
-
}
|
|
399
|
-
//#endregion
|
|
400
|
-
//#region src/bot/profiles.ts
|
|
401
|
-
var we = {
|
|
402
|
-
egg: [
|
|
403
|
-
.8369,
|
|
404
|
-
.8424,
|
|
405
|
-
.8497,
|
|
406
|
-
.8585,
|
|
407
|
-
.8674,
|
|
408
|
-
.8775,
|
|
409
|
-
.8878,
|
|
410
|
-
.8983,
|
|
411
|
-
.9089,
|
|
412
|
-
.9185,
|
|
413
|
-
.9288,
|
|
414
|
-
.9374,
|
|
415
|
-
.9445,
|
|
416
|
-
.9504,
|
|
417
|
-
.9543,
|
|
418
|
-
.9559,
|
|
419
|
-
.9555,
|
|
420
|
-
.9519,
|
|
421
|
-
.9466,
|
|
422
|
-
.9389,
|
|
423
|
-
.9302,
|
|
424
|
-
.9193,
|
|
425
|
-
.9085,
|
|
426
|
-
.8969,
|
|
427
|
-
.8852,
|
|
428
|
-
.8734,
|
|
429
|
-
.8625,
|
|
430
|
-
.8513,
|
|
431
|
-
.8411,
|
|
432
|
-
.8325,
|
|
433
|
-
.8243,
|
|
434
|
-
.8179,
|
|
435
|
-
.8137,
|
|
436
|
-
.8112,
|
|
437
|
-
.8102,
|
|
438
|
-
.8128,
|
|
439
|
-
.8178,
|
|
440
|
-
.8262,
|
|
441
|
-
.8374,
|
|
442
|
-
.8518,
|
|
443
|
-
.8702,
|
|
444
|
-
.8922,
|
|
445
|
-
.9169,
|
|
446
|
-
.9446,
|
|
447
|
-
.9741,
|
|
448
|
-
1.0023,
|
|
449
|
-
1.0267,
|
|
450
|
-
1.0433,
|
|
451
|
-
1.0481,
|
|
452
|
-
1.0393,
|
|
453
|
-
1.0216,
|
|
454
|
-
.997,
|
|
455
|
-
.9697,
|
|
456
|
-
.9418,
|
|
457
|
-
.9169,
|
|
458
|
-
.8949,
|
|
459
|
-
.876,
|
|
460
|
-
.8604,
|
|
461
|
-
.849,
|
|
462
|
-
.8394,
|
|
463
|
-
.8337,
|
|
464
|
-
.8314,
|
|
465
|
-
.8305,
|
|
466
|
-
.8326
|
|
467
|
-
],
|
|
468
|
-
hexagon: [
|
|
469
|
-
.921,
|
|
470
|
-
.9282,
|
|
471
|
-
.9441,
|
|
472
|
-
.9706,
|
|
473
|
-
.9984,
|
|
474
|
-
1.0059,
|
|
475
|
-
.9896,
|
|
476
|
-
.9562,
|
|
477
|
-
.929,
|
|
478
|
-
.9124,
|
|
479
|
-
.9047,
|
|
480
|
-
.9058,
|
|
481
|
-
.9157,
|
|
482
|
-
.9349,
|
|
483
|
-
.9642,
|
|
484
|
-
.9873,
|
|
485
|
-
.9882,
|
|
486
|
-
.9665,
|
|
487
|
-
.9336,
|
|
488
|
-
.9105,
|
|
489
|
-
.8968,
|
|
490
|
-
.8918,
|
|
491
|
-
.8955,
|
|
492
|
-
.908,
|
|
493
|
-
.9293,
|
|
494
|
-
.9611,
|
|
495
|
-
.982,
|
|
496
|
-
.9812,
|
|
497
|
-
.959,
|
|
498
|
-
.9282,
|
|
499
|
-
.9089,
|
|
500
|
-
.8978,
|
|
501
|
-
.8964,
|
|
502
|
-
.9026,
|
|
503
|
-
.9189,
|
|
504
|
-
.9439,
|
|
505
|
-
.9778,
|
|
506
|
-
.999,
|
|
507
|
-
.9964,
|
|
508
|
-
.9713,
|
|
509
|
-
.9439,
|
|
510
|
-
.9274,
|
|
511
|
-
.9196,
|
|
512
|
-
.9206,
|
|
513
|
-
.9308,
|
|
514
|
-
.9502,
|
|
515
|
-
.9799,
|
|
516
|
-
1.0121,
|
|
517
|
-
1.0226,
|
|
518
|
-
1.0071,
|
|
519
|
-
.9752,
|
|
520
|
-
.951,
|
|
521
|
-
.9366,
|
|
522
|
-
.9316,
|
|
523
|
-
.9351,
|
|
524
|
-
.9485,
|
|
525
|
-
.9711,
|
|
526
|
-
1.0026,
|
|
527
|
-
1.0213,
|
|
528
|
-
1.0155,
|
|
529
|
-
.9863,
|
|
530
|
-
.9547,
|
|
531
|
-
.9347,
|
|
532
|
-
.9232
|
|
533
|
-
],
|
|
534
|
-
triangle: [
|
|
535
|
-
.7819,
|
|
536
|
-
.8211,
|
|
537
|
-
.8747,
|
|
538
|
-
.944,
|
|
539
|
-
1.0223,
|
|
540
|
-
1.096,
|
|
541
|
-
1.1401,
|
|
542
|
-
1.134,
|
|
543
|
-
1.0808,
|
|
544
|
-
1.0047,
|
|
545
|
-
.9265,
|
|
546
|
-
.8603,
|
|
547
|
-
.8104,
|
|
548
|
-
.773,
|
|
549
|
-
.745,
|
|
550
|
-
.7273,
|
|
551
|
-
.7151,
|
|
552
|
-
.7118,
|
|
553
|
-
.7148,
|
|
554
|
-
.7245,
|
|
555
|
-
.7427,
|
|
556
|
-
.768,
|
|
557
|
-
.8037,
|
|
558
|
-
.8518,
|
|
559
|
-
.9148,
|
|
560
|
-
.9876,
|
|
561
|
-
1.0583,
|
|
562
|
-
1.1073,
|
|
563
|
-
1.1109,
|
|
564
|
-
1.0667,
|
|
565
|
-
.994,
|
|
566
|
-
.9164,
|
|
567
|
-
.8482,
|
|
568
|
-
.7948,
|
|
569
|
-
.7555,
|
|
570
|
-
.7261,
|
|
571
|
-
.7056,
|
|
572
|
-
.6925,
|
|
573
|
-
.6859,
|
|
574
|
-
.6869,
|
|
575
|
-
.6938,
|
|
576
|
-
.7084,
|
|
577
|
-
.7305,
|
|
578
|
-
.7615,
|
|
579
|
-
.804,
|
|
580
|
-
.8595,
|
|
581
|
-
.9311,
|
|
582
|
-
1.0092,
|
|
583
|
-
1.0791,
|
|
584
|
-
1.1171,
|
|
585
|
-
1.1054,
|
|
586
|
-
1.0501,
|
|
587
|
-
.9779,
|
|
588
|
-
.905,
|
|
589
|
-
.845,
|
|
590
|
-
.799,
|
|
591
|
-
.7656,
|
|
592
|
-
.7413,
|
|
593
|
-
.7258,
|
|
594
|
-
.716,
|
|
595
|
-
.7146,
|
|
596
|
-
.7204,
|
|
597
|
-
.733,
|
|
598
|
-
.7528
|
|
599
|
-
]
|
|
600
|
-
}, Te = Array.from({ length: 64 }, (e, t) => t / 64 * y), Ee = Te.map(Math.cos), V = Te.map(Math.sin);
|
|
601
|
-
function De(e, t = {}) {
|
|
602
|
-
return {
|
|
603
|
-
radii: [...we[e]],
|
|
604
|
-
rot: 0,
|
|
605
|
-
cx: 0,
|
|
606
|
-
cy: 0,
|
|
607
|
-
sx: 1,
|
|
608
|
-
sy: 1,
|
|
609
|
-
...t
|
|
610
|
-
};
|
|
611
|
-
}
|
|
612
|
-
function H(e, t = {}) {
|
|
613
|
-
return {
|
|
614
|
-
radii: Array(64).fill(e),
|
|
615
|
-
rot: 0,
|
|
616
|
-
cx: 0,
|
|
617
|
-
cy: 0,
|
|
618
|
-
sx: 1,
|
|
619
|
-
sy: 1,
|
|
620
|
-
...t
|
|
621
|
-
};
|
|
622
|
-
}
|
|
623
|
-
function Oe(e, t, n, r) {
|
|
624
|
-
let i = r ?? {
|
|
625
|
-
radii: Array(64),
|
|
626
|
-
rot: 0,
|
|
627
|
-
cx: 0,
|
|
628
|
-
cy: 0,
|
|
629
|
-
sx: 1,
|
|
630
|
-
sy: 1
|
|
631
|
-
};
|
|
632
|
-
for (let r = 0; r < 64; r++) i.radii[r] = x(e.radii[r] ?? 1, t.radii[r] ?? 1, n);
|
|
633
|
-
let a = t.rot - e.rot;
|
|
634
|
-
for (; a > Math.PI;) a -= y;
|
|
635
|
-
for (; a < -Math.PI;) a += y;
|
|
636
|
-
return i.rot = e.rot + a * n, i.cx = x(e.cx, t.cx, n), i.cy = x(e.cy, t.cy, n), i.sx = x(e.sx, t.sx, n), i.sy = x(e.sy, t.sy, n), i;
|
|
637
|
-
}
|
|
638
|
-
function ke(e, t, n = []) {
|
|
639
|
-
let r = Math.cos(e.rot), i = Math.sin(e.rot);
|
|
640
|
-
for (let a = 0; a < 64; a++) {
|
|
641
|
-
let o = e.radii[a] ?? 1, s = o * (Ee[a] ?? 0), c = o * (V[a] ?? 0), l = s * r - c * i, u = s * i + c * r, d = n[a] ?? {
|
|
642
|
-
x: 0,
|
|
643
|
-
y: 0
|
|
644
|
-
};
|
|
645
|
-
d.x = (l * e.sx + e.cx) * t, d.y = (u * e.sy + e.cy) * t, n[a] = d;
|
|
646
|
-
}
|
|
647
|
-
return n.length = 64, n;
|
|
648
|
-
}
|
|
649
|
-
function Ae(e, t = 1 / 6) {
|
|
650
|
-
let n = e.length;
|
|
651
|
-
if (n < 3) return "";
|
|
652
|
-
let r = e[0], i = `M${T(r.x)} ${T(r.y)}`;
|
|
653
|
-
for (let r = 0; r < n; r++) {
|
|
654
|
-
let a = e[(r - 1 + n) % n], o = e[r], s = e[(r + 1) % n], c = e[(r + 2) % n], l = o.x + (s.x - a.x) * t, u = o.y + (s.y - a.y) * t, d = s.x - (c.x - o.x) * t, f = s.y - (c.y - o.y) * t;
|
|
655
|
-
i += `C${T(l)} ${T(u)} ${T(d)} ${T(f)} ${T(s.x)} ${T(s.y)}`;
|
|
656
|
-
}
|
|
657
|
-
return `${i}Z`;
|
|
658
|
-
}
|
|
659
|
-
function U(e, t, n) {
|
|
660
|
-
let r = Array(64).fill(0), i = e.length;
|
|
661
|
-
for (let a = 0; a < 64; a++) {
|
|
662
|
-
let o = Ee[a] ?? 0, s = V[a] ?? 0, c = 0;
|
|
663
|
-
for (let r = 0; r < i; r++) {
|
|
664
|
-
let a = e[r], l = e[(r + 1) % i], u = l.x - a.x, d = l.y - a.y, f = o * d - s * u;
|
|
665
|
-
if (Math.abs(f) < 1e-9) continue;
|
|
666
|
-
let p = a.x - t, m = a.y - n, h = (p * d - m * u) / f, g = (p * s - m * o) / f;
|
|
667
|
-
h > c && g >= 0 && g <= 1 && (c = h);
|
|
668
|
-
}
|
|
669
|
-
r[a] = c;
|
|
670
|
-
}
|
|
671
|
-
return r;
|
|
672
|
-
}
|
|
673
|
-
function W(e, t, n, r, i, a, o = 96) {
|
|
674
|
-
let s = r - e, c = i - t, l = Math.hypot(s, c) || 1e-6, u = Math.atan2(c, s), d = Math.acos(Math.max(-1, Math.min(1, (n - a) / l))), f = [];
|
|
675
|
-
for (let r = 0; r <= o / 2; r++) {
|
|
676
|
-
let i = u + d + (y - 2 * d) * r / (o / 2);
|
|
677
|
-
f.push({
|
|
678
|
-
x: e + Math.cos(i) * n,
|
|
679
|
-
y: t + Math.sin(i) * n
|
|
680
|
-
});
|
|
681
|
-
}
|
|
682
|
-
for (let e = 0; e <= o / 2; e++) {
|
|
683
|
-
let t = u - d + 2 * d * e / (o / 2);
|
|
684
|
-
f.push({
|
|
685
|
-
x: r + Math.cos(t) * a,
|
|
686
|
-
y: i + Math.sin(t) * a
|
|
687
|
-
});
|
|
688
|
-
}
|
|
689
|
-
return f;
|
|
690
|
-
}
|
|
691
|
-
function je(e, t) {
|
|
692
|
-
let n = e.length, r = (t / y % 1 + 1) % 1 * n, i = Math.floor(r);
|
|
693
|
-
return x(e[i % n] ?? 1, e[(i + 1) % n] ?? 1, r - i);
|
|
694
|
-
}
|
|
695
|
-
function Me(e, t = 1, n = 1) {
|
|
696
|
-
return Te.map((r, i) => (Math.abs((Ee[i] ?? 0) / t) ** e + Math.abs((V[i] ?? 0) / n) ** e) ** (-1 / e));
|
|
697
|
-
}
|
|
698
|
-
function Ne(e) {
|
|
699
|
-
let t = Array(64).fill(0);
|
|
700
|
-
for (let n = 0; n < 64; n++) {
|
|
701
|
-
let r = Ee[n] ?? 0, i = V[n] ?? 0, a = 0;
|
|
702
|
-
for (let t of e) {
|
|
703
|
-
let e = r * t.x + i * t.y, n = e * e - (t.x * t.x + t.y * t.y - t.r * t.r);
|
|
704
|
-
if (n < 0) continue;
|
|
705
|
-
let o = e + Math.sqrt(n);
|
|
706
|
-
o > a && (a = o);
|
|
707
|
-
}
|
|
708
|
-
t[n] = a;
|
|
709
|
-
}
|
|
710
|
-
return t;
|
|
711
|
-
}
|
|
712
|
-
function Pe(e, t, n = 10) {
|
|
713
|
-
let r = e.length, i = [], a = (e, t) => {
|
|
714
|
-
let n = t.x - e.x, r = t.y - e.y, i = Math.hypot(n, r) || 1;
|
|
715
|
-
return Math.atan2(-n / i, r / i);
|
|
716
|
-
};
|
|
717
|
-
for (let o = 0; o < r; o++) {
|
|
718
|
-
let s = e[(o - 1 + r) % r], c = e[o], l = e[(o + 1) % r], u = a(s, c), d = a(c, l) - u;
|
|
719
|
-
for (; d > Math.PI;) d -= y;
|
|
720
|
-
for (; d < -Math.PI;) d += y;
|
|
721
|
-
for (let e = 0; e <= n; e++) {
|
|
722
|
-
let r = u + d * e / n;
|
|
723
|
-
i.push({
|
|
724
|
-
x: c.x + Math.cos(r) * t,
|
|
725
|
-
y: c.y + Math.sin(r) * t
|
|
726
|
-
});
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
return i;
|
|
730
|
-
}
|
|
731
|
-
function Fe(e, t, n, r = 0) {
|
|
732
|
-
let i = r * Math.PI / 180;
|
|
733
|
-
return U(Pe(Array.from({ length: e }, (r, a) => {
|
|
734
|
-
let o = i + a / e * y;
|
|
735
|
-
return {
|
|
736
|
-
x: Math.cos(o) * (t - n),
|
|
737
|
-
y: Math.sin(o) * (t - n)
|
|
738
|
-
};
|
|
739
|
-
}), n), 0, 0);
|
|
740
|
-
}
|
|
741
|
-
function Ie(e, t = 1) {
|
|
742
|
-
if (e.length < 3) return "";
|
|
743
|
-
let n = "";
|
|
744
|
-
for (let r = 0; r < e.length; r++) {
|
|
745
|
-
let i = e[r];
|
|
746
|
-
n += `${r === 0 ? "M" : "L"}${T(i.x * t)} ${T(i.y * t)}`;
|
|
747
|
-
}
|
|
748
|
-
return `${n}Z`;
|
|
749
|
-
}
|
|
750
|
-
function Le(e, t) {
|
|
751
|
-
let n = Math.max(e, .01) / 2, r = Math.max(t, .01) / 2, i = Math.min(n, r);
|
|
752
|
-
return `M${T(-n)} ${T(-r + i)}A${T(i)} ${T(i)} 0 0 1 ${T(-n + i)} ${T(-r)}L${T(n - i)} ${T(-r)}A${T(i)} ${T(i)} 0 0 1 ${T(n)} ${T(-r + i)}L${T(n)} ${T(r - i)}A${T(i)} ${T(i)} 0 0 1 ${T(n - i)} ${T(r)}L${T(-n + i)} ${T(r)}A${T(i)} ${T(i)} 0 0 1 ${T(-n)} ${T(r - i)}Z`;
|
|
753
|
-
}
|
|
754
|
-
//#endregion
|
|
755
|
-
//#region src/bot/skins.ts
|
|
756
|
-
function G(e, t = 1) {
|
|
757
|
-
let n = Math.max(...e);
|
|
758
|
-
if (n <= 0) return e;
|
|
759
|
-
let r = t / n;
|
|
760
|
-
return e.map((e) => e * r);
|
|
761
|
-
}
|
|
762
|
-
var K = G(Array.from({ length: 64 }, (e, t) => t / 64 * Math.PI * 2).map((e) => 1 + .075 * Math.cos(2 * e + .5) + .035 * Math.cos(3 * e + 2.1)), 1.02), Re = G(Ne([
|
|
763
|
-
{
|
|
764
|
-
x: -.44,
|
|
765
|
-
y: .2,
|
|
766
|
-
r: .54
|
|
767
|
-
},
|
|
768
|
-
{
|
|
769
|
-
x: .46,
|
|
770
|
-
y: .2,
|
|
771
|
-
r: .5
|
|
772
|
-
},
|
|
773
|
-
{
|
|
774
|
-
x: .02,
|
|
775
|
-
y: .3,
|
|
776
|
-
r: .6
|
|
777
|
-
},
|
|
778
|
-
{
|
|
779
|
-
x: -.24,
|
|
780
|
-
y: -.3,
|
|
781
|
-
r: .48
|
|
782
|
-
},
|
|
783
|
-
{
|
|
784
|
-
x: .3,
|
|
785
|
-
y: -.24,
|
|
786
|
-
r: .44
|
|
787
|
-
}
|
|
788
|
-
]), 1.02), q = G(U(W(0, .28, .66, 0, -.96, .05), 0, 0), 1.04), ze = U(W(-.42, 0, .62, .42, 0, .62), 0, 0), Be = [
|
|
789
|
-
{
|
|
790
|
-
id: "cercle",
|
|
791
|
-
radii: Array(64).fill(1)
|
|
792
|
-
},
|
|
793
|
-
{
|
|
794
|
-
id: "galet",
|
|
795
|
-
radii: K
|
|
796
|
-
},
|
|
797
|
-
{
|
|
798
|
-
id: "squircle",
|
|
799
|
-
radii: G(Me(4.2), 1.15)
|
|
800
|
-
},
|
|
801
|
-
{
|
|
802
|
-
id: "capsule",
|
|
803
|
-
radii: ze
|
|
804
|
-
},
|
|
805
|
-
{
|
|
806
|
-
id: "triangle",
|
|
807
|
-
radii: Fe(3, 1.12, .34, -90)
|
|
808
|
-
},
|
|
809
|
-
{
|
|
810
|
-
id: "hexagone",
|
|
811
|
-
radii: Fe(6, 1.04, .26, 0)
|
|
812
|
-
},
|
|
813
|
-
{
|
|
814
|
-
id: "nuage",
|
|
815
|
-
radii: Re
|
|
816
|
-
},
|
|
817
|
-
{
|
|
818
|
-
id: "goutte",
|
|
819
|
-
radii: q
|
|
820
|
-
}
|
|
821
|
-
], Ve = new Map(Be.map((e) => [e.id, e])), He = "cercle", Ue = [
|
|
822
|
-
{
|
|
823
|
-
id: "encre",
|
|
824
|
-
hex: "#0a0a0c"
|
|
825
|
-
},
|
|
826
|
-
{
|
|
827
|
-
id: "brun",
|
|
828
|
-
hex: "#8b5e3c"
|
|
829
|
-
},
|
|
830
|
-
{
|
|
831
|
-
id: "rouge",
|
|
832
|
-
hex: "#e8483f"
|
|
833
|
-
},
|
|
834
|
-
{
|
|
835
|
-
id: "orange",
|
|
836
|
-
hex: "#f08a24"
|
|
837
|
-
},
|
|
838
|
-
{
|
|
839
|
-
id: "ambre",
|
|
840
|
-
hex: "#f0b429"
|
|
841
|
-
},
|
|
842
|
-
{
|
|
843
|
-
id: "vert",
|
|
844
|
-
hex: "#3ecf8e"
|
|
845
|
-
},
|
|
846
|
-
{
|
|
847
|
-
id: "turquoise",
|
|
848
|
-
hex: "#2fbfa0"
|
|
849
|
-
},
|
|
850
|
-
{
|
|
851
|
-
id: "bleu",
|
|
852
|
-
hex: "#3b93f0"
|
|
853
|
-
},
|
|
854
|
-
{
|
|
855
|
-
id: "violet",
|
|
856
|
-
hex: "#8b5cf6"
|
|
857
|
-
},
|
|
858
|
-
{
|
|
859
|
-
id: "rose",
|
|
860
|
-
hex: "#e152b0"
|
|
861
|
-
},
|
|
862
|
-
{
|
|
863
|
-
id: "gris",
|
|
864
|
-
hex: "#a3a3a3"
|
|
865
|
-
},
|
|
866
|
-
{
|
|
867
|
-
id: "creme",
|
|
868
|
-
hex: "#f1efe9"
|
|
869
|
-
}
|
|
870
|
-
], We = new Map(Ue.map((e) => [e.id, e])), Ge = "encre";
|
|
871
|
-
function Ke(e, t, n) {
|
|
872
|
-
let r = (e) => {
|
|
873
|
-
let t = parseInt(e.slice(1), 16);
|
|
874
|
-
return [
|
|
875
|
-
t >> 16 & 255,
|
|
876
|
-
t >> 8 & 255,
|
|
877
|
-
t & 255
|
|
878
|
-
];
|
|
879
|
-
}, i = r(e), a = r(t);
|
|
880
|
-
return `#${i.map((e, t) => Math.round(e + (a[t] - e) * n)).map((e) => e.toString(16).padStart(2, "0")).join("")}`;
|
|
881
|
-
}
|
|
882
|
-
//#endregion
|
|
883
|
-
//#region src/bot/states.ts
|
|
884
|
-
var J = (e, t) => [{
|
|
885
|
-
w: e,
|
|
886
|
-
h: t,
|
|
887
|
-
open: 1
|
|
888
|
-
}, {
|
|
889
|
-
w: e,
|
|
890
|
-
h: t,
|
|
891
|
-
open: 1
|
|
892
|
-
}];
|
|
893
|
-
function Y(e = {}) {
|
|
894
|
-
return {
|
|
895
|
-
sil: H(1),
|
|
896
|
-
offX: 0,
|
|
897
|
-
offY: 0,
|
|
898
|
-
gaze: { ...P },
|
|
899
|
-
split: M,
|
|
900
|
-
eyes: J(N, pe),
|
|
901
|
-
eyeAlpha: 1,
|
|
902
|
-
bodyAlpha: 1,
|
|
903
|
-
dots: [],
|
|
904
|
-
arcs: [],
|
|
905
|
-
notif: null,
|
|
906
|
-
dotsBehind: !1,
|
|
907
|
-
...e
|
|
908
|
-
};
|
|
909
|
-
}
|
|
910
|
-
var qe = -.1875, Je = U(W(0, -.505, .132, 0, .13, .075), 0, qe), X = U(W(0, -.2535, .1345, 0, .2535, .1345), 0, 0), Ye = (e = {}) => ({
|
|
911
|
-
radii: [...Je],
|
|
912
|
-
rot: 0,
|
|
913
|
-
cx: 0,
|
|
914
|
-
cy: qe,
|
|
915
|
-
sx: 1,
|
|
916
|
-
sy: 1,
|
|
917
|
-
...e
|
|
918
|
-
}), Xe = (e = {}) => ({
|
|
919
|
-
radii: [...X],
|
|
920
|
-
rot: 0,
|
|
921
|
-
cx: 0,
|
|
922
|
-
cy: 0,
|
|
923
|
-
sx: 1,
|
|
924
|
-
sy: 1,
|
|
925
|
-
...e
|
|
926
|
-
}), Ze = Ie(W(0, 0, .118, 0, .172, .012)), Qe = .213;
|
|
927
|
-
function $e(e) {
|
|
928
|
-
return De("triangle", {
|
|
929
|
-
rot: e,
|
|
930
|
-
cx: -.213 * Math.sin(e),
|
|
931
|
-
cy: Qe * Math.cos(e)
|
|
932
|
-
});
|
|
933
|
-
}
|
|
934
|
-
function et(e, t) {
|
|
935
|
-
let n = ((e - t * .5) / 1.5 % 1 + 1) % 1;
|
|
936
|
-
return b((n < .5 ? .5 - .5 * Math.cos(n * y) : 0) * 2);
|
|
937
|
-
}
|
|
938
|
-
var tt = [
|
|
939
|
-
{
|
|
940
|
-
id: "idle",
|
|
941
|
-
duration: 2.4,
|
|
942
|
-
morph: .45,
|
|
943
|
-
blinkIn: !1,
|
|
944
|
-
baseFace: !0,
|
|
945
|
-
baseBody: !0,
|
|
946
|
-
pose: () => Y()
|
|
947
|
-
},
|
|
948
|
-
{
|
|
949
|
-
id: "thinking",
|
|
950
|
-
duration: 2.6,
|
|
951
|
-
morph: .4,
|
|
952
|
-
baseFace: !1,
|
|
953
|
-
baseBody: !1,
|
|
954
|
-
blinkIn: !0,
|
|
955
|
-
pose: (e) => {
|
|
956
|
-
let t = et(e, 1), n = .3 + .7 * S.easeOutCubic(b(e / .3));
|
|
957
|
-
return Y({
|
|
958
|
-
sil: H(ne * (1 + (re - 1) * t), { cx: k[1] }),
|
|
959
|
-
eyeAlpha: 0,
|
|
960
|
-
dots: [0, 2].map((t) => {
|
|
961
|
-
let r = et(e, t);
|
|
962
|
-
return {
|
|
963
|
-
x: k[t] * n,
|
|
964
|
-
y: 0,
|
|
965
|
-
r: ne * (1 + (re - 1) * r),
|
|
966
|
-
opacity: .55 + .45 * r
|
|
967
|
-
};
|
|
968
|
-
})
|
|
969
|
-
});
|
|
970
|
-
}
|
|
971
|
-
},
|
|
972
|
-
{
|
|
973
|
-
id: "wink",
|
|
974
|
-
duration: 1.6,
|
|
975
|
-
morph: .3,
|
|
976
|
-
blinkIn: !0,
|
|
977
|
-
baseFace: !1,
|
|
978
|
-
baseBody: !0,
|
|
979
|
-
pose: () => Y({
|
|
980
|
-
gaze: {
|
|
981
|
-
yaw: -5.37,
|
|
982
|
-
pitch: 4.55,
|
|
983
|
-
roll: 6.7
|
|
984
|
-
},
|
|
985
|
-
split: 16.25,
|
|
986
|
-
eyes: [{
|
|
987
|
-
w: .236,
|
|
988
|
-
h: .464,
|
|
989
|
-
open: 1
|
|
990
|
-
}, {
|
|
991
|
-
w: .447,
|
|
992
|
-
h: .089,
|
|
993
|
-
open: 1
|
|
994
|
-
}]
|
|
995
|
-
})
|
|
996
|
-
},
|
|
997
|
-
{
|
|
998
|
-
id: "wide",
|
|
999
|
-
duration: 1.8,
|
|
1000
|
-
morph: .55,
|
|
1001
|
-
blinkIn: !0,
|
|
1002
|
-
baseFace: !1,
|
|
1003
|
-
baseBody: !0,
|
|
1004
|
-
pose: () => Y({
|
|
1005
|
-
gaze: {
|
|
1006
|
-
yaw: 6.92,
|
|
1007
|
-
pitch: -21.96,
|
|
1008
|
-
roll: 11.6
|
|
1009
|
-
},
|
|
1010
|
-
split: 18.43,
|
|
1011
|
-
eyes: J(.356, .875)
|
|
1012
|
-
})
|
|
1013
|
-
},
|
|
1014
|
-
{
|
|
1015
|
-
id: "alert",
|
|
1016
|
-
duration: 2.4,
|
|
1017
|
-
minDuration: 2,
|
|
1018
|
-
morph: .45,
|
|
1019
|
-
baseFace: !1,
|
|
1020
|
-
baseBody: !1,
|
|
1021
|
-
blinkIn: !1,
|
|
1022
|
-
pose: (e) => {
|
|
1023
|
-
let t = b(e / 1.5), n = S.easeInOutCubic(t) * .82 - .087, r = e > 1.6 ? b((e - 1.6) / .4) : 0, i = n * (1 - r) + .1 * r, a = Math.sin(e * 2.5 * y) * .005, o = 17.7 * Math.PI / 180;
|
|
1024
|
-
return Y({
|
|
1025
|
-
sil: Xe({
|
|
1026
|
-
rot: o,
|
|
1027
|
-
cx: i,
|
|
1028
|
-
cy: -.325 - a
|
|
1029
|
-
}),
|
|
1030
|
-
eyeAlpha: 0,
|
|
1031
|
-
dots: [{
|
|
1032
|
-
x: i - Math.sin(o) * .58,
|
|
1033
|
-
y: -.325 + Math.cos(o) * .58 + a * 2.8,
|
|
1034
|
-
r: .118,
|
|
1035
|
-
d: Ze,
|
|
1036
|
-
rot: o * 180 / Math.PI,
|
|
1037
|
-
opacity: 1
|
|
1038
|
-
}]
|
|
1039
|
-
});
|
|
1040
|
-
}
|
|
1041
|
-
},
|
|
1042
|
-
{
|
|
1043
|
-
id: "notify",
|
|
1044
|
-
duration: 2.2,
|
|
1045
|
-
morph: .5,
|
|
1046
|
-
blinkIn: !0,
|
|
1047
|
-
baseFace: !1,
|
|
1048
|
-
baseBody: !0,
|
|
1049
|
-
pose: (e) => {
|
|
1050
|
-
let t = b(e / .45), n = 1 + (de - 1) * Math.sin(t * Math.PI) * (1 - t * .35), r = ue * (t < 1 ? n : 1), i = -42 * Math.PI / 180;
|
|
1051
|
-
return Y({
|
|
1052
|
-
gaze: {
|
|
1053
|
-
yaw: -21.94,
|
|
1054
|
-
pitch: -5.82,
|
|
1055
|
-
roll: -12.2
|
|
1056
|
-
},
|
|
1057
|
-
split: 18.89,
|
|
1058
|
-
eyes: J(.505, .498),
|
|
1059
|
-
notif: {
|
|
1060
|
-
x: Math.cos(i) * j,
|
|
1061
|
-
y: Math.sin(i) * j,
|
|
1062
|
-
r,
|
|
1063
|
-
notch: r + fe
|
|
1064
|
-
}
|
|
1065
|
-
});
|
|
1066
|
-
}
|
|
1067
|
-
},
|
|
1068
|
-
{
|
|
1069
|
-
id: "exclaim",
|
|
1070
|
-
duration: 2,
|
|
1071
|
-
morph: .45,
|
|
1072
|
-
baseFace: !1,
|
|
1073
|
-
baseBody: !1,
|
|
1074
|
-
blinkIn: !1,
|
|
1075
|
-
pose: () => Y({
|
|
1076
|
-
sil: Ye(),
|
|
1077
|
-
eyeAlpha: 0,
|
|
1078
|
-
dots: [{
|
|
1079
|
-
x: -.012,
|
|
1080
|
-
y: .526,
|
|
1081
|
-
r: .113,
|
|
1082
|
-
opacity: 1
|
|
1083
|
-
}]
|
|
1084
|
-
})
|
|
1085
|
-
},
|
|
1086
|
-
{
|
|
1087
|
-
id: "sleep",
|
|
1088
|
-
duration: 2.4,
|
|
1089
|
-
morph: .5,
|
|
1090
|
-
baseFace: !1,
|
|
1091
|
-
baseBody: !1,
|
|
1092
|
-
blinkIn: !1,
|
|
1093
|
-
pose: (e) => Y({
|
|
1094
|
-
sil: H(.1585, { cy: .11 + Math.sin(y / .6 * e) * .19 }),
|
|
1095
|
-
eyeAlpha: 0
|
|
1096
|
-
})
|
|
1097
|
-
},
|
|
1098
|
-
{
|
|
1099
|
-
id: "egg",
|
|
1100
|
-
duration: 1.8,
|
|
1101
|
-
morph: .4,
|
|
1102
|
-
baseFace: !1,
|
|
1103
|
-
baseBody: !1,
|
|
1104
|
-
blinkIn: !0,
|
|
1105
|
-
pose: () => Y({
|
|
1106
|
-
sil: De("egg"),
|
|
1107
|
-
gaze: {
|
|
1108
|
-
yaw: 19.97,
|
|
1109
|
-
pitch: 26.01,
|
|
1110
|
-
roll: -17.1
|
|
1111
|
-
},
|
|
1112
|
-
split: 11.07,
|
|
1113
|
-
eyes: J(.164, .385)
|
|
1114
|
-
})
|
|
1115
|
-
},
|
|
1116
|
-
{
|
|
1117
|
-
id: "hexagon",
|
|
1118
|
-
duration: 1.6,
|
|
1119
|
-
morph: .4,
|
|
1120
|
-
baseFace: !1,
|
|
1121
|
-
baseBody: !1,
|
|
1122
|
-
blinkIn: !0,
|
|
1123
|
-
pose: () => Y({
|
|
1124
|
-
sil: De("hexagon"),
|
|
1125
|
-
gaze: {
|
|
1126
|
-
yaw: 23.11,
|
|
1127
|
-
pitch: 24.42,
|
|
1128
|
-
roll: -13.3
|
|
1129
|
-
},
|
|
1130
|
-
split: 13.37,
|
|
1131
|
-
eyes: J(.177, .411)
|
|
1132
|
-
})
|
|
1133
|
-
},
|
|
1134
|
-
{
|
|
1135
|
-
id: "play",
|
|
1136
|
-
duration: 2,
|
|
1137
|
-
morph: .5,
|
|
1138
|
-
baseFace: !1,
|
|
1139
|
-
baseBody: !1,
|
|
1140
|
-
blinkIn: !0,
|
|
1141
|
-
pose: (e) => {
|
|
1142
|
-
let t = b(e / .35) * b((2.2 - e) / .5);
|
|
1143
|
-
return Y({
|
|
1144
|
-
sil: $e(0),
|
|
1145
|
-
gaze: {
|
|
1146
|
-
yaw: 12,
|
|
1147
|
-
pitch: -8,
|
|
1148
|
-
roll: -6
|
|
1149
|
-
},
|
|
1150
|
-
split: 15,
|
|
1151
|
-
eyes: J(.18, .34),
|
|
1152
|
-
arcs: te.map((n, r) => ({
|
|
1153
|
-
id: `sw${r}`,
|
|
1154
|
-
seed: {
|
|
1155
|
-
...n,
|
|
1156
|
-
cx: .45 - e * .42
|
|
1157
|
-
},
|
|
1158
|
-
t: e,
|
|
1159
|
-
opacity: t
|
|
1160
|
-
}))
|
|
1161
|
-
});
|
|
1162
|
-
}
|
|
1163
|
-
},
|
|
1164
|
-
{
|
|
1165
|
-
id: "orbit",
|
|
1166
|
-
duration: 3.4,
|
|
1167
|
-
minDuration: 2.5,
|
|
1168
|
-
morph: .6,
|
|
1169
|
-
baseFace: !1,
|
|
1170
|
-
baseBody: !1,
|
|
1171
|
-
blinkIn: !1,
|
|
1172
|
-
pose: (e) => {
|
|
1173
|
-
let t = S.easeInOutCubic(b(e / .35)), n = -y * 1.25 * e * t, r = S.easeInOutCubic(b((e - 1.6) / .9)), i = $e(n), a = H(1, { rot: n }), o = {
|
|
1174
|
-
radii: i.radii.map((e, t) => e + (a.radii[t] - e) * r),
|
|
1175
|
-
rot: n,
|
|
1176
|
-
cx: i.cx * (1 - r),
|
|
1177
|
-
cy: i.cy * (1 - r),
|
|
1178
|
-
sx: 1,
|
|
1179
|
-
sy: 1
|
|
1180
|
-
}, s = b(e / .8) * b((3.6 - e) / .9);
|
|
1181
|
-
return Y({
|
|
1182
|
-
sil: o,
|
|
1183
|
-
gaze: {
|
|
1184
|
-
yaw: P.yaw + Math.sin(e * 6.5) * 65 * (1 - r),
|
|
1185
|
-
pitch: -4 + r * 32,
|
|
1186
|
-
roll: -13
|
|
1187
|
-
},
|
|
1188
|
-
eyes: J(.18, .34 + r * .07),
|
|
1189
|
-
arcs: O.map((t, n) => ({
|
|
1190
|
-
id: `rg${n}`,
|
|
1191
|
-
seed: t,
|
|
1192
|
-
t: e,
|
|
1193
|
-
opacity: s * b((e - n * .13) / .3)
|
|
1194
|
-
}))
|
|
1195
|
-
});
|
|
1196
|
-
}
|
|
1197
|
-
},
|
|
1198
|
-
{
|
|
1199
|
-
id: "swirl",
|
|
1200
|
-
duration: 1.3,
|
|
1201
|
-
minDuration: 1.3,
|
|
1202
|
-
morph: .3,
|
|
1203
|
-
baseFace: !0,
|
|
1204
|
-
baseBody: !0,
|
|
1205
|
-
blinkIn: !0,
|
|
1206
|
-
pose: (e) => Y({ arcs: O.slice(0, 3).map((t, n) => ({
|
|
1207
|
-
id: `sw${n}`,
|
|
1208
|
-
seed: t,
|
|
1209
|
-
t: e,
|
|
1210
|
-
opacity: b((e - n * .06) / .14) * b((1.22 - e) / .34)
|
|
1211
|
-
})) })
|
|
1212
|
-
},
|
|
1213
|
-
{
|
|
1214
|
-
id: "burst",
|
|
1215
|
-
duration: 2.6,
|
|
1216
|
-
minDuration: 2.4,
|
|
1217
|
-
morph: .4,
|
|
1218
|
-
baseFace: !1,
|
|
1219
|
-
baseBody: !1,
|
|
1220
|
-
blinkIn: !1,
|
|
1221
|
-
pose: (e) => {
|
|
1222
|
-
let t = 1 - .834 * S.easeOutQuint(b(e / .7)), n = S.easeOutQuint(b((e - 1.7) / .7));
|
|
1223
|
-
return Y({
|
|
1224
|
-
sil: H(t + (1 - t) * n),
|
|
1225
|
-
eyeAlpha: b((e - 1.85) / .4),
|
|
1226
|
-
dots: oe(e, 1),
|
|
1227
|
-
dotsBehind: !0
|
|
1228
|
-
});
|
|
1229
|
-
}
|
|
1230
|
-
},
|
|
1231
|
-
{
|
|
1232
|
-
id: "comet",
|
|
1233
|
-
duration: 2.4,
|
|
1234
|
-
minDuration: 2.4,
|
|
1235
|
-
morph: .45,
|
|
1236
|
-
baseFace: !1,
|
|
1237
|
-
baseBody: !1,
|
|
1238
|
-
blinkIn: !1,
|
|
1239
|
-
pose: (e) => {
|
|
1240
|
-
let t = 1 - (1 - A) * S.easeOutQuint(b(e / .55)), n = S.easeOutQuint(b((e - 1.85) / .6)), r = b((e - .15) / .25) * b((1.95 - e) / .3);
|
|
1241
|
-
return Y({
|
|
1242
|
-
sil: H(t + (1 - t) * n, { cy: Math.sin(b(e / 1.7) * Math.PI) * .035 }),
|
|
1243
|
-
eyeAlpha: b((e - 2) / .35),
|
|
1244
|
-
arcs: ce.map((t, n) => ({
|
|
1245
|
-
id: `cm${n}`,
|
|
1246
|
-
seed: t,
|
|
1247
|
-
t: e,
|
|
1248
|
-
opacity: r
|
|
1249
|
-
}))
|
|
1250
|
-
});
|
|
1251
|
-
}
|
|
1252
|
-
}
|
|
1253
|
-
], Z = new Map(tt.map((e) => [e.id, e])), nt = {
|
|
1254
|
-
idle: 1,
|
|
1255
|
-
thinking: 1.1,
|
|
1256
|
-
wink: .8,
|
|
1257
|
-
wide: .8,
|
|
1258
|
-
alert: .75,
|
|
1259
|
-
notify: .9,
|
|
1260
|
-
exclaim: .8,
|
|
1261
|
-
sleep: .45,
|
|
1262
|
-
egg: .8,
|
|
1263
|
-
hexagon: .8,
|
|
1264
|
-
play: .9,
|
|
1265
|
-
orbit: 1.2,
|
|
1266
|
-
swirl: .5,
|
|
1267
|
-
burst: .45,
|
|
1268
|
-
comet: 1.15
|
|
1269
|
-
}, rt = [
|
|
1270
|
-
"idle",
|
|
1271
|
-
"thinking",
|
|
1272
|
-
"wink",
|
|
1273
|
-
"wide",
|
|
1274
|
-
"alert",
|
|
1275
|
-
"notify",
|
|
1276
|
-
"exclaim",
|
|
1277
|
-
"sleep",
|
|
1278
|
-
"egg",
|
|
1279
|
-
"hexagon",
|
|
1280
|
-
"play",
|
|
1281
|
-
"orbit",
|
|
1282
|
-
"burst",
|
|
1283
|
-
"comet"
|
|
1284
|
-
], Q = 100, it = 7.1, at = 5.5, ot = .006, st = .007;
|
|
1285
|
-
function ct(e, t, n) {
|
|
1286
|
-
let r = [], i = L(e.gaze, Q, e.split);
|
|
1287
|
-
for (let a = 0; a < 2; a++) {
|
|
1288
|
-
let o = i[a];
|
|
1289
|
-
if (o.depth <= .02) continue;
|
|
1290
|
-
let s = e.eyes[a], c = (s.tilt ?? 0) * Math.PI / 180, l = Math.cos(c), u = Math.sin(c), d = o.a * l + o.c * u, f = o.b * l + o.d * u, p = -o.a * u + o.c * l, m = -o.b * u + o.d * l, h = Math.max(s.w * Q, .01) / 2, g = Math.max(s.h * Q, .01) / 2, _ = Math.min(h, g), v = g > h, y = v ? g - _ : h - _, b = je(n, Math.atan2(o.y, o.x) - t.rot);
|
|
1291
|
-
r.push({
|
|
1292
|
-
x: o.x * b,
|
|
1293
|
-
y: o.y * b,
|
|
1294
|
-
ax: (v ? p : d) * y,
|
|
1295
|
-
ay: (v ? m : f) * y,
|
|
1296
|
-
r: _,
|
|
1297
|
-
m: [
|
|
1298
|
-
d,
|
|
1299
|
-
f,
|
|
1300
|
-
p,
|
|
1301
|
-
m
|
|
1302
|
-
]
|
|
1303
|
-
});
|
|
1304
|
-
}
|
|
1305
|
-
return r;
|
|
1306
|
-
}
|
|
1307
|
-
function lt(e, t, n, r, i) {
|
|
1308
|
-
let a = r - t, o = i - n, s = a * a + o * o, c = Infinity, l = 0, u = 0;
|
|
1309
|
-
for (let r = 0; r < e.length; r++) {
|
|
1310
|
-
let i = e[r], d = s > 0 ? ((i.x - t) * a + (i.y - n) * o) / s : 0;
|
|
1311
|
-
d = d < 0 ? 0 : d > 1 ? 1 : d;
|
|
1312
|
-
let f = t + d * a - i.x, p = n + d * o - i.y, m = f * f + p * p;
|
|
1313
|
-
m < c && (c = m, l = f, u = p);
|
|
1314
|
-
}
|
|
1315
|
-
let d = Math.sqrt(c);
|
|
1316
|
-
return {
|
|
1317
|
-
d,
|
|
1318
|
-
ux: d > 1e-9 ? l / d : 0,
|
|
1319
|
-
uy: d > 1e-9 ? u / d : 0
|
|
1320
|
-
};
|
|
1321
|
-
}
|
|
1322
|
-
var ut = Math.hypot(ot, st) * Q;
|
|
1323
|
-
function dt(e, t, n, r) {
|
|
1324
|
-
let i = Infinity, a = 0, o = 0;
|
|
1325
|
-
for (let s of t) {
|
|
1326
|
-
let t = s.x + n, c = s.y + r, l = lt(e, t - s.ax, c - s.ay, t + s.ax, c + s.ay), [u, d, f, p] = s.m, m = s.r * Math.hypot(u * l.ux + d * l.uy, f * l.ux + p * l.uy) + ut;
|
|
1327
|
-
l.d - m < i && (i = l.d - m, a = l.ux, o = l.uy);
|
|
1328
|
-
}
|
|
1329
|
-
return {
|
|
1330
|
-
marge: i,
|
|
1331
|
-
ux: a,
|
|
1332
|
-
uy: o
|
|
1333
|
-
};
|
|
1334
|
-
}
|
|
1335
|
-
var ft = 12, pt = 8;
|
|
1336
|
-
function mt(e) {
|
|
1337
|
-
if (!e.length) return {
|
|
1338
|
-
x: 0,
|
|
1339
|
-
y: 0
|
|
1340
|
-
};
|
|
1341
|
-
let t = (t, n) => {
|
|
1342
|
-
let r = Infinity;
|
|
1343
|
-
for (let i of e) r = Math.min(r, dt(i.contour, i.empreintes, t, n).marge);
|
|
1344
|
-
return r;
|
|
1345
|
-
}, n = Infinity;
|
|
1346
|
-
for (let t of e) n = Math.min(n, dt(t.calContour, t.reference, 0, 0).marge);
|
|
1347
|
-
let r = 0, i = 0, a = e[0].empreintes;
|
|
1348
|
-
for (let e of a) r -= e.x / a.length, i -= e.y / a.length;
|
|
1349
|
-
let o = Math.max(.35 * Q, Math.hypot(r, i) * 1.25);
|
|
1350
|
-
n = Math.min(n, t(r, i));
|
|
1351
|
-
let s = t(0, 0);
|
|
1352
|
-
if (s >= n && s >= 0) return {
|
|
1353
|
-
x: 0,
|
|
1354
|
-
y: 0
|
|
1355
|
-
};
|
|
1356
|
-
let c = Math.max(n, 0), l = 0, u = 0, d = Infinity, f = 0, p = 0, m = s;
|
|
1357
|
-
for (let e = 0; e < ft; e++) {
|
|
1358
|
-
let n = e / ft * Math.PI * 2, r = Math.cos(n), i = Math.sin(n);
|
|
1359
|
-
if (t(r * o, i * o) < c) {
|
|
1360
|
-
for (let e of [
|
|
1361
|
-
.3,
|
|
1362
|
-
.6,
|
|
1363
|
-
1
|
|
1364
|
-
]) {
|
|
1365
|
-
let n = t(r * o * e, i * o * e);
|
|
1366
|
-
n > m && (m = n, f = r * o * e, p = i * o * e);
|
|
1367
|
-
}
|
|
1368
|
-
continue;
|
|
1369
|
-
}
|
|
1370
|
-
let a = 0, s = o;
|
|
1371
|
-
for (let e = 0; e < pt; e++) {
|
|
1372
|
-
let e = (a + s) / 2;
|
|
1373
|
-
t(r * e, i * e) >= c ? s = e : a = e;
|
|
1374
|
-
}
|
|
1375
|
-
s < d && (d = s, l = r * s, u = i * s);
|
|
1376
|
-
}
|
|
1377
|
-
let h = d === Infinity ? f : l, g = d === Infinity ? p : u;
|
|
1378
|
-
return {
|
|
1379
|
-
x: +(h / Q).toFixed(6),
|
|
1380
|
-
y: +(g / Q).toFixed(6)
|
|
1381
|
-
};
|
|
1382
|
-
}
|
|
1383
|
-
function ht(e, t, n) {
|
|
1384
|
-
return e.baseFace && n ? {
|
|
1385
|
-
gaze: n.gaze,
|
|
1386
|
-
split: n.split,
|
|
1387
|
-
eyes: n.eyes
|
|
1388
|
-
} : {
|
|
1389
|
-
gaze: t.gaze,
|
|
1390
|
-
split: t.split,
|
|
1391
|
-
eyes: t.eyes
|
|
1392
|
-
};
|
|
1393
|
-
}
|
|
1394
|
-
function gt(e) {
|
|
1395
|
-
let t = (e) => JSON.stringify([
|
|
1396
|
-
e.gaze,
|
|
1397
|
-
e.split,
|
|
1398
|
-
e.eyes,
|
|
1399
|
-
e.sil.rot,
|
|
1400
|
-
e.sil.cx,
|
|
1401
|
-
e.sil.cy,
|
|
1402
|
-
e.sil.sx,
|
|
1403
|
-
e.sil.sy
|
|
1404
|
-
]);
|
|
1405
|
-
return t(e.pose(0)) === t(e.pose(e.duration)) ? [0] : Array.from({ length: 3 }, (t, n) => n / 2 * e.duration);
|
|
1406
|
-
}
|
|
1407
|
-
function _t(e, t, n) {
|
|
1408
|
-
let r = [];
|
|
1409
|
-
for (let i of gt(e)) {
|
|
1410
|
-
let a = e.pose(i), o = ke({
|
|
1411
|
-
...a.sil,
|
|
1412
|
-
radii: t
|
|
1413
|
-
}, Q), s = ke(a.sil, Q), c = ht(e, a, n), l = [];
|
|
1414
|
-
for (let e of [-7.1, it]) for (let t of [-5.5, at]) l.push({
|
|
1415
|
-
...c,
|
|
1416
|
-
gaze: {
|
|
1417
|
-
yaw: c.gaze.yaw + e,
|
|
1418
|
-
pitch: c.gaze.pitch + t,
|
|
1419
|
-
roll: c.gaze.roll
|
|
1420
|
-
}
|
|
1421
|
-
});
|
|
1422
|
-
for (let e of l) r.push({
|
|
1423
|
-
empreintes: ct(e, a.sil, t),
|
|
1424
|
-
reference: ct(e, a.sil, a.sil.radii),
|
|
1425
|
-
contour: o,
|
|
1426
|
-
calContour: s
|
|
1427
|
-
});
|
|
1428
|
-
}
|
|
1429
|
-
return mt(r);
|
|
1430
|
-
}
|
|
1431
|
-
var vt = {
|
|
1432
|
-
x: 0,
|
|
1433
|
-
y: 0
|
|
1434
|
-
}, yt = (e, t) => `${e}|${t ?? ""}`;
|
|
1435
|
-
function bt() {
|
|
1436
|
-
return new Map(Be.map((e) => {
|
|
1437
|
-
let t = /* @__PURE__ */ new Map();
|
|
1438
|
-
for (let n of tt) {
|
|
1439
|
-
if (!n.baseBody) continue;
|
|
1440
|
-
let r = n.baseFace ? [null, ...ye] : [null];
|
|
1441
|
-
for (let i of r) t.set(yt(n.id, i?.id ?? null), _t(n, e.radii, i));
|
|
1442
|
-
}
|
|
1443
|
-
return [e.radii, t];
|
|
1444
|
-
}));
|
|
1445
|
-
}
|
|
1446
|
-
var xt = bt();
|
|
1447
|
-
function St(e, t, n) {
|
|
1448
|
-
if (!e) return vt;
|
|
1449
|
-
let r = xt.get(e);
|
|
1450
|
-
return r ? r.get(yt(t, n)) ?? r.get(yt(t, null)) ?? vt : vt;
|
|
1451
|
-
}
|
|
1452
|
-
//#endregion
|
|
1453
|
-
//#region src/bot/engine.ts
|
|
1454
|
-
var Ct = {
|
|
1455
|
-
yaw: 0,
|
|
1456
|
-
pitch: 0,
|
|
1457
|
-
mix: 0,
|
|
1458
|
-
spin: 0,
|
|
1459
|
-
wander: 1
|
|
1460
|
-
}, wt = (e, t, n) => ({
|
|
1461
|
-
yaw: x(e.yaw, t.yaw, n),
|
|
1462
|
-
pitch: x(e.pitch, t.pitch, n),
|
|
1463
|
-
mix: x(e.mix, t.mix, n),
|
|
1464
|
-
spin: x(e.spin, t.spin, n),
|
|
1465
|
-
wander: x(e.wander, t.wander, n)
|
|
1466
|
-
}), Tt = (e, t, n) => ({
|
|
1467
|
-
w: x(e.w, t.w, n),
|
|
1468
|
-
h: x(e.h, t.h, n),
|
|
1469
|
-
open: x(e.open, t.open, n),
|
|
1470
|
-
tilt: x(e.tilt ?? 0, t.tilt ?? 0, n)
|
|
1471
|
-
});
|
|
1472
|
-
function Et(e, t, n) {
|
|
1473
|
-
let r = 1 - n;
|
|
1474
|
-
return {
|
|
1475
|
-
sil: Oe(e.sil, t.sil, n),
|
|
1476
|
-
offX: x(e.offX, t.offX, n),
|
|
1477
|
-
offY: x(e.offY, t.offY, n),
|
|
1478
|
-
gaze: {
|
|
1479
|
-
yaw: x(e.gaze.yaw, t.gaze.yaw, n),
|
|
1480
|
-
pitch: x(e.gaze.pitch, t.gaze.pitch, n),
|
|
1481
|
-
roll: x(e.gaze.roll, t.gaze.roll, n)
|
|
1482
|
-
},
|
|
1483
|
-
split: x(e.split, t.split, n),
|
|
1484
|
-
eyes: [Tt(e.eyes[0], t.eyes[0], n), Tt(e.eyes[1], t.eyes[1], n)],
|
|
1485
|
-
eyeAlpha: x(e.eyeAlpha, t.eyeAlpha, n),
|
|
1486
|
-
bodyAlpha: x(e.bodyAlpha, t.bodyAlpha, n),
|
|
1487
|
-
dots: [...e.dots.map((e) => ({
|
|
1488
|
-
...e,
|
|
1489
|
-
opacity: e.opacity * r
|
|
1490
|
-
})), ...t.dots.map((e) => ({
|
|
1491
|
-
...e,
|
|
1492
|
-
opacity: e.opacity * n
|
|
1493
|
-
}))],
|
|
1494
|
-
arcs: [...e.arcs.map((e) => ({
|
|
1495
|
-
...e,
|
|
1496
|
-
id: `a${e.id}`,
|
|
1497
|
-
opacity: e.opacity * r
|
|
1498
|
-
})), ...t.arcs.map((e) => ({
|
|
1499
|
-
...e,
|
|
1500
|
-
id: `b${e.id}`,
|
|
1501
|
-
opacity: e.opacity * n
|
|
1502
|
-
}))],
|
|
1503
|
-
notif: n < .5 ? e.notif : t.notif,
|
|
1504
|
-
dotsBehind: n < .5 ? e.dotsBehind : t.dotsBehind
|
|
1505
|
-
};
|
|
1506
|
-
}
|
|
1507
|
-
var Dt = class e {
|
|
1508
|
-
scale;
|
|
1509
|
-
cur;
|
|
1510
|
-
prev = null;
|
|
1511
|
-
departFige = null;
|
|
1512
|
-
tCur = 0;
|
|
1513
|
-
tPrev = 0;
|
|
1514
|
-
blinkAt = -10;
|
|
1515
|
-
pts = [];
|
|
1516
|
-
shape = null;
|
|
1517
|
-
shapePrev = null;
|
|
1518
|
-
shapeAt = -10;
|
|
1519
|
-
expr = null;
|
|
1520
|
-
exprPrev = null;
|
|
1521
|
-
exprAt = -10;
|
|
1522
|
-
look = Ct;
|
|
1523
|
-
lookPrev = Ct;
|
|
1524
|
-
lookAt = -10;
|
|
1525
|
-
lookMorph = .24;
|
|
1526
|
-
static SHAPE_MORPH = .45;
|
|
1527
|
-
static LOOK_MORPH = .24;
|
|
1528
|
-
constructor(e = 100, t = "idle", n = null, r = null) {
|
|
1529
|
-
this.scale = e, this.cur = t, this.shape = n, this.expr = r;
|
|
1530
|
-
}
|
|
1531
|
-
setExpression(e, t = 0) {
|
|
1532
|
-
e !== this.expr && (this.exprPrev = this.expr, this.expr = e, this.exprAt = t);
|
|
1533
|
-
}
|
|
1534
|
-
exprAtTime(t) {
|
|
1535
|
-
let n = this.expr, r = this.exprPrev;
|
|
1536
|
-
if (!n || !r) return n;
|
|
1537
|
-
let i = (t - this.exprAt) / e.SHAPE_MORPH;
|
|
1538
|
-
return i >= 1 ? n : Ce(r, n, S.easeOutQuint(b(i)));
|
|
1539
|
-
}
|
|
1540
|
-
setShape(e, t = 0) {
|
|
1541
|
-
e !== this.shape && (this.shapePrev = this.shape, this.shape = e, this.shapeAt = t);
|
|
1542
|
-
}
|
|
1543
|
-
shapeAtTime(t) {
|
|
1544
|
-
let n = this.shape, r = this.shapePrev;
|
|
1545
|
-
if (!n || !r) return n;
|
|
1546
|
-
let i = (t - this.shapeAt) / e.SHAPE_MORPH;
|
|
1547
|
-
if (i >= 1) return n;
|
|
1548
|
-
let a = S.easeOutQuint(b(i));
|
|
1549
|
-
return n.map((e, t) => x(r[t] ?? e, e, a));
|
|
1550
|
-
}
|
|
1551
|
-
setLook(t, n, r = e.LOOK_MORPH) {
|
|
1552
|
-
t && !Number.isFinite(t.yaw + t.pitch + t.mix + t.spin + t.wander) || (this.lookPrev = this.lookAtTime(n), this.look = t ?? Ct, this.lookAt = n, this.lookMorph = r);
|
|
1553
|
-
}
|
|
1554
|
-
lookAtTime(e) {
|
|
1555
|
-
let t = (e - this.lookAt) / this.lookMorph;
|
|
1556
|
-
return t >= 1 ? this.look : wt(this.lookPrev, this.look, S.easeOutQuint(b(t)));
|
|
1557
|
-
}
|
|
1558
|
-
posed(e, t, n, r) {
|
|
1559
|
-
let i = e.pose(t);
|
|
1560
|
-
return e.baseBody && n && (i = {
|
|
1561
|
-
...i,
|
|
1562
|
-
sil: {
|
|
1563
|
-
...i.sil,
|
|
1564
|
-
radii: n
|
|
1565
|
-
}
|
|
1566
|
-
}), e.baseFace && r && (i = {
|
|
1567
|
-
...i,
|
|
1568
|
-
gaze: r.gaze,
|
|
1569
|
-
split: r.split,
|
|
1570
|
-
eyes: r.eyes
|
|
1571
|
-
}), i;
|
|
1572
|
-
}
|
|
1573
|
-
decalageAtTime(t, n) {
|
|
1574
|
-
let r = (e, n, r, i) => {
|
|
1575
|
-
if (r === i) return i;
|
|
1576
|
-
let a = (t - e) / n;
|
|
1577
|
-
if (a >= 1) return i;
|
|
1578
|
-
let o = S.easeOutQuint(b(a));
|
|
1579
|
-
return {
|
|
1580
|
-
x: x(r.x, i.x, o),
|
|
1581
|
-
y: x(r.y, i.y, o)
|
|
1582
|
-
};
|
|
1583
|
-
}, i = (t) => r(this.exprAt, e.SHAPE_MORPH, St(t, n, this.exprPrev?.id ?? null), St(t, n, this.expr?.id ?? null));
|
|
1584
|
-
return r(this.shapeAt, e.SHAPE_MORPH, i(this.shapePrev), i(this.shape));
|
|
1585
|
-
}
|
|
1586
|
-
get state() {
|
|
1587
|
-
return this.cur;
|
|
1588
|
-
}
|
|
1589
|
-
reset(e, t) {
|
|
1590
|
-
this.cur = e, this.prev = null, this.departFige = null, this.tCur = t, this.tPrev = t, this.blinkAt = -10;
|
|
1591
|
-
}
|
|
1592
|
-
origine(e, t, n) {
|
|
1593
|
-
if (this.departFige) return this.departFige;
|
|
1594
|
-
if (!this.prev) return null;
|
|
1595
|
-
let r = Z.get(this.prev);
|
|
1596
|
-
return this.posed(r, Math.max(0, e - this.tPrev), t, n);
|
|
1597
|
-
}
|
|
1598
|
-
poseComposee(e) {
|
|
1599
|
-
let t = Z.get(this.cur), n = this.shapeAtTime(e), r = this.exprAtTime(e), i = this.posed(t, Math.max(0, e - this.tCur), n, r), a = e - this.tCur;
|
|
1600
|
-
if (a >= t.morph) return i;
|
|
1601
|
-
let o = this.origine(e, n, r);
|
|
1602
|
-
return o ? Et(o, i, S.easeOutQuint(b(a / t.morph))) : i;
|
|
1603
|
-
}
|
|
1604
|
-
setState(e, t) {
|
|
1605
|
-
if (e === this.cur) return;
|
|
1606
|
-
let n = Z.get(this.cur).morph, r = this.prev !== null && t - this.tCur < n;
|
|
1607
|
-
this.departFige = r ? this.poseComposee(t) : null, this.prev = this.cur, this.tPrev = this.tCur, this.cur = e, this.tCur = t, Z.get(e)?.blinkIn && (this.blinkAt = t);
|
|
1608
|
-
}
|
|
1609
|
-
sample(e) {
|
|
1610
|
-
let t = this.scale, n = Z.get(this.cur), r = this.shapeAtTime(e), i = this.exprAtTime(e), a = this.posed(n, Math.max(0, e - this.tCur), r, i), o = this.decalageAtTime(e, this.cur), s = e - this.tCur, c = s < n.morph ? this.origine(e, r, i) : null;
|
|
1611
|
-
if (c) {
|
|
1612
|
-
let t = S.easeOutQuint(b(s / n.morph));
|
|
1613
|
-
a = Et(c, a, t);
|
|
1614
|
-
let r = this.prev;
|
|
1615
|
-
if (r) {
|
|
1616
|
-
let n = this.decalageAtTime(e, r);
|
|
1617
|
-
o = {
|
|
1618
|
-
x: x(n.x, o.x, t),
|
|
1619
|
-
y: x(n.y, o.y, t)
|
|
1620
|
-
};
|
|
1621
|
-
}
|
|
1622
|
-
}
|
|
1623
|
-
let l = a.eyeAlpha > .01, u = this.lookAtTime(e), d = _e(e, {
|
|
1624
|
-
wander: l ? u.wander : 0,
|
|
1625
|
-
blink: l
|
|
1626
|
-
}), f = {
|
|
1627
|
-
yaw: x(a.gaze.yaw, u.yaw, u.mix) + d.dYaw - u.spin,
|
|
1628
|
-
pitch: x(a.gaze.pitch, u.pitch, u.mix) + d.dPitch,
|
|
1629
|
-
roll: a.gaze.roll + d.dRoll
|
|
1630
|
-
}, p = b((e - this.blinkAt) / .2), m = p < 1 ? Math.abs(p * 2 - 1) : 1, h = Math.min(d.lid, m), g = a.offX + d.driftX, _ = a.offY + d.driftY, v = Ae(ke({
|
|
1631
|
-
...a.sil,
|
|
1632
|
-
cx: a.sil.cx + g,
|
|
1633
|
-
cy: a.sil.cy + _,
|
|
1634
|
-
sy: a.sil.sy * d.breath
|
|
1635
|
-
}, t, this.pts)), y = (e, t) => je(a.sil.radii, Math.atan2(t, e) - a.sil.rot), C = [];
|
|
1636
|
-
if (a.eyeAlpha > .01) {
|
|
1637
|
-
let e = L(f, t, a.split);
|
|
1638
|
-
for (let n = 0; n < 2; n++) {
|
|
1639
|
-
let r = e[n];
|
|
1640
|
-
if (r.depth <= .02) continue;
|
|
1641
|
-
let i = a.eyes[n], s = y(r.x, r.y), c = (i.tilt ?? 0) * Math.PI / 180, l = Math.cos(c), u = Math.sin(c), d = r.a * l + r.c * u, f = r.b * l + r.d * u, p = -r.a * u + r.c * l, m = -r.b * u + r.d * l, v = ve(Math.min(h, i.open));
|
|
1642
|
-
C.push({
|
|
1643
|
-
d: Le(i.w * t, i.h * t),
|
|
1644
|
-
matrix: `matrix(${T(d)},${T(f * v)},${T(p)},${T(m * v)},${T(r.x * s + (g + o.x) * t)},${T(r.y * s + (_ + o.y) * t)})`,
|
|
1645
|
-
alpha: a.eyeAlpha * b(r.depth / .12)
|
|
1646
|
-
});
|
|
1647
|
-
}
|
|
1648
|
-
}
|
|
1649
|
-
let w = a.dots.filter((e) => e.opacity > .01 && e.r > 5e-4).map((e) => ({
|
|
1650
|
-
...e,
|
|
1651
|
-
x: (e.x + g) * t,
|
|
1652
|
-
y: (e.y + _) * t,
|
|
1653
|
-
r: e.r * t
|
|
1654
|
-
})), E = a.notif ? y(a.notif.x, a.notif.y) : 1, D = a.notif ? (a.notif.x * E + g) * t : 0, O = a.notif ? (a.notif.y * E + _) * t : 0, te = a.notif ? {
|
|
1655
|
-
x: D,
|
|
1656
|
-
y: O,
|
|
1657
|
-
r: a.notif.r * t
|
|
1658
|
-
} : null, k = a.notif ? {
|
|
1659
|
-
x: D,
|
|
1660
|
-
y: O,
|
|
1661
|
-
r: a.notif.notch * t
|
|
1662
|
-
} : null;
|
|
1663
|
-
return {
|
|
1664
|
-
bodyPath: v,
|
|
1665
|
-
bodyAlpha: a.bodyAlpha,
|
|
1666
|
-
eyes: C,
|
|
1667
|
-
dots: w,
|
|
1668
|
-
dotsBehind: a.dotsBehind,
|
|
1669
|
-
arcs: a.arcs.filter((e) => e.opacity > .01).map((e) => ee(e.seed, e.t, t, e.id, e.opacity)),
|
|
1670
|
-
notif: te,
|
|
1671
|
-
notch: k
|
|
1672
|
-
};
|
|
1673
|
-
}
|
|
1674
|
-
}, Ot = 1.1, kt = 1.5, At = (e) => ({
|
|
1675
|
-
yaw: 0,
|
|
1676
|
-
pitch: 0,
|
|
1677
|
-
mix: 0,
|
|
1678
|
-
spin: 360 * (1 - S.easeInOutCubic(b(e / kt))),
|
|
1679
|
-
wander: 1
|
|
1680
|
-
});
|
|
1681
|
-
function jt({ nx: e, ny: t, tour: n, pointer: r }) {
|
|
1682
|
-
return {
|
|
1683
|
-
yaw: -26 + e * 16,
|
|
1684
|
-
pitch: 10 - t * 13,
|
|
1685
|
-
mix: n,
|
|
1686
|
-
spin: 360 * (1 - n),
|
|
1687
|
-
wander: +!r
|
|
1688
|
-
};
|
|
1689
|
-
}
|
|
1690
|
-
//#endregion
|
|
1691
|
-
//#region src/bot/cycles.ts
|
|
1692
|
-
var Mt = Math.max(...tt.map((e) => e.morph)), Nt = 10, Pt = 200, Ft = 50, It = .1, Lt = "defaut";
|
|
1693
|
-
function Rt(e) {
|
|
1694
|
-
return Math.max(Mt, Z.get(e)?.minDuration ?? Mt);
|
|
1695
|
-
}
|
|
1696
|
-
function zt(e, t) {
|
|
1697
|
-
let n = Math.round(t / It) * It, r = Math.min(10, Math.max(Rt(e), n));
|
|
1698
|
-
return Math.round(r * 100) / 100;
|
|
1699
|
-
}
|
|
1700
|
-
function Bt(e) {
|
|
1701
|
-
return {
|
|
1702
|
-
state: e,
|
|
1703
|
-
duration: zt(e, Z.get(e)?.duration ?? 2)
|
|
1704
|
-
};
|
|
1705
|
-
}
|
|
1706
|
-
function Vt() {
|
|
1707
|
-
return {
|
|
1708
|
-
name: "",
|
|
1709
|
-
id: Lt,
|
|
1710
|
-
blocks: rt.map(Bt)
|
|
1711
|
-
};
|
|
1712
|
-
}
|
|
1713
|
-
function Ht(e) {
|
|
1714
|
-
return e.reduce((e, t) => e + t.duration, 0);
|
|
1715
|
-
}
|
|
1716
|
-
function Ut(e, t) {
|
|
1717
|
-
let n = 0;
|
|
1718
|
-
for (let r = 0; r < t && r < e.length; r++) n += e[r].duration;
|
|
1719
|
-
return n;
|
|
1720
|
-
}
|
|
1721
|
-
function Wt(e, t) {
|
|
1722
|
-
let n = Ht(e);
|
|
1723
|
-
if (!e.length || n <= 0) return {
|
|
1724
|
-
index: 0,
|
|
1725
|
-
elapsed: 0
|
|
1726
|
-
};
|
|
1727
|
-
let r = t >= 0 && t < n ? t : (t % n + n) % n, i = 0;
|
|
1728
|
-
for (let t = 0; t < e.length; t++) {
|
|
1729
|
-
let n = i + e[t].duration;
|
|
1730
|
-
if (r < n) return {
|
|
1731
|
-
index: t,
|
|
1732
|
-
elapsed: r - i
|
|
1733
|
-
};
|
|
1734
|
-
i = n;
|
|
1735
|
-
}
|
|
1736
|
-
return {
|
|
1737
|
-
index: e.length - 1,
|
|
1738
|
-
elapsed: 0
|
|
1739
|
-
};
|
|
1740
|
-
}
|
|
1741
|
-
function Gt(e, t) {
|
|
1742
|
-
return e.length >= 200 ? e : [...e, Bt(t)];
|
|
1743
|
-
}
|
|
1744
|
-
function Kt(e, t, n) {
|
|
1745
|
-
let r = e.slice(), [i] = r.splice(t, 1);
|
|
1746
|
-
return i ? (r.splice(Math.min(Math.max(n, 0), r.length), 0, i), r) : e;
|
|
1747
|
-
}
|
|
1748
|
-
function qt(e, t) {
|
|
1749
|
-
let n = new Set(t.map((e) => e.name));
|
|
1750
|
-
if (!n.has(e)) return e;
|
|
1751
|
-
let r = 2;
|
|
1752
|
-
for (; n.has(`${e} ${r}`);) r++;
|
|
1753
|
-
return `${e} ${r}`;
|
|
1754
|
-
}
|
|
1755
|
-
function Jt(e) {
|
|
1756
|
-
let t = new Set(e.map((e) => e.id)), n = 1;
|
|
1757
|
-
for (; t.has(`c${n}`);) n++;
|
|
1758
|
-
return `c${n}`;
|
|
1759
|
-
}
|
|
1760
|
-
function Yt(e) {
|
|
1761
|
-
if (typeof e != "object" || !e) return null;
|
|
1762
|
-
let { state: t, duration: n } = e;
|
|
1763
|
-
return typeof t != "string" || !rt.includes(t) || typeof n != "number" || !Number.isFinite(n) ? null : {
|
|
1764
|
-
state: t,
|
|
1765
|
-
duration: zt(t, n)
|
|
1766
|
-
};
|
|
1767
|
-
}
|
|
1768
|
-
function Xt(e, t) {
|
|
1769
|
-
if (typeof e != "object" || !e) return null;
|
|
1770
|
-
let { id: n, name: r, blocks: i } = e;
|
|
1771
|
-
if (typeof n != "string" || !n || typeof r != "string" || !Array.isArray(i)) return null;
|
|
1772
|
-
let a = i.slice(0, 200).map(Yt).filter((e) => e !== null);
|
|
1773
|
-
return !a.length || t.some((e) => e.id === n) ? null : {
|
|
1774
|
-
id: n,
|
|
1775
|
-
name: r,
|
|
1776
|
-
blocks: a
|
|
1777
|
-
};
|
|
1778
|
-
}
|
|
1779
|
-
function Zt(e) {
|
|
1780
|
-
if (!e) return [];
|
|
1781
|
-
let t;
|
|
1782
|
-
try {
|
|
1783
|
-
t = JSON.parse(e);
|
|
1784
|
-
} catch {
|
|
1785
|
-
return [];
|
|
1786
|
-
}
|
|
1787
|
-
if (!Array.isArray(t)) return [];
|
|
1788
|
-
let n = [];
|
|
1789
|
-
for (let e of t.slice(0, 50)) {
|
|
1790
|
-
let t = Xt(e, n);
|
|
1791
|
-
t && n.push(t);
|
|
1792
|
-
}
|
|
1793
|
-
return n;
|
|
1794
|
-
}
|
|
1795
|
-
//#endregion
|
|
1796
|
-
//#region src/bot/repere.ts
|
|
1797
|
-
var Qt = 100, $t = 158, en = /* @__PURE__ */ l("<svg><g></svg>", 2), tn = /* @__PURE__ */ l("<svg role=img><defs><mask maskUnits=userSpaceOnUse><path fill=#fff></path><!><!></mask></defs><g fill=none stroke-linecap=round></g><g><path></path><g><rect></rect></g></g><!><g fill=none stroke-linecap=round>"), nn = /* @__PURE__ */ l("<svg><path fill=#000></svg>", 2), rn = /* @__PURE__ */ l("<svg><circle fill=#000></svg>", 2), an = /* @__PURE__ */ l("<svg><linearGradient gradientUnits=userSpaceOnUse></svg>", 2), on = /* @__PURE__ */ l("<svg><stop></svg>", 2), sn = /* @__PURE__ */ l("<svg><path></svg>", 2), cn = /* @__PURE__ */ l("<svg><circle></svg>", 2);
|
|
1798
|
-
function $(e, t, n) {
|
|
1799
|
-
f(e, (e, n) => {
|
|
1800
|
-
v(() => t(e, n));
|
|
1801
|
-
}, n?.defer ? { defer: !0 } : void 0);
|
|
1802
|
-
}
|
|
1803
|
-
function ln(l) {
|
|
1804
|
-
let y = a({
|
|
1805
|
-
size: 320,
|
|
1806
|
-
shape: He,
|
|
1807
|
-
color: Ge,
|
|
1808
|
-
expression: xe,
|
|
1809
|
-
paper: "#f9f9f9",
|
|
1810
|
-
cycle: Vt().blocks,
|
|
1811
|
-
follow: !1,
|
|
1812
|
-
gaze: null,
|
|
1813
|
-
autoPause: !0,
|
|
1814
|
-
ariaLabel: "Animated Bloub avatar"
|
|
1815
|
-
}, l), [x, C] = m(0), [w, T] = m("idle"), [E] = m(!1), [ee, D] = m(0), O = () => l.block ?? x(), te = () => l.state ?? w(), k = () => l.playing ?? E(), ne = () => l.elapsed ?? ee();
|
|
1816
|
-
function re(e) {
|
|
1817
|
-
l.block === void 0 && C(e), l.onBlockChange?.(e);
|
|
1818
|
-
}
|
|
1819
|
-
function ie(e) {
|
|
1820
|
-
l.state === void 0 && T(e), l.onStateChange?.(e);
|
|
1821
|
-
}
|
|
1822
|
-
function ae(e) {
|
|
1823
|
-
l.elapsed === void 0 && D(e), l.onElapsedChange?.(e);
|
|
1824
|
-
}
|
|
1825
|
-
let oe = p(() => Ve.get(y.shape)?.radii ?? null), se = p(() => We.get(y.color)?.hex ?? "#0a0a0c"), ce = p(() => be.get(y.expression) ?? null), A = v(() => new Dt(100, te(), oe(), ce())), [j, ue] = m(v(() => A.sample(y.frozenAt ?? 0)), { equals: !1 }), de = h(), fe = `bot-mask-${de}`, M, N = 0, pe = -Infinity, P = Infinity, F = 0, I = 0, L = 0, me = 0, he = -1;
|
|
1826
|
-
function R(e, t = 0) {
|
|
1827
|
-
let n = y.cycle[e];
|
|
1828
|
-
if (!n) {
|
|
1829
|
-
P = Infinity;
|
|
1830
|
-
return;
|
|
1831
|
-
}
|
|
1832
|
-
L = I - t, ae(t), ie(n.state), A.setState(n.state, I), P = k() ? L + n.duration : Infinity;
|
|
1833
|
-
}
|
|
1834
|
-
function ge(e) {
|
|
1835
|
-
re(e), R(e);
|
|
1836
|
-
}
|
|
1837
|
-
function _e(e, t = 0) {
|
|
1838
|
-
if (O() === e) {
|
|
1839
|
-
R(e, t);
|
|
1840
|
-
return;
|
|
1841
|
-
}
|
|
1842
|
-
me = t, re(e);
|
|
1843
|
-
}
|
|
1844
|
-
function ve(e) {
|
|
1845
|
-
let t = y.cycle;
|
|
1846
|
-
if (!t.length) return;
|
|
1847
|
-
let { index: n } = Wt(t, e);
|
|
1848
|
-
if (n !== he) {
|
|
1849
|
-
let e = t[n];
|
|
1850
|
-
ie(e.state), n < he ? A.reset(e.state, Ut(t, n)) : A.setState(e.state, Ut(t, n)), he = n;
|
|
1851
|
-
}
|
|
1852
|
-
ue(A.sample(e));
|
|
1853
|
-
}
|
|
1854
|
-
let z = null, B = !1, ye = 0, Se = 0, Ce = !1, we = 1 / 60;
|
|
1855
|
-
function Te(e) {
|
|
1856
|
-
e.pointerType !== "touch" && (z = {
|
|
1857
|
-
x: e.clientX,
|
|
1858
|
-
y: e.clientY
|
|
1859
|
-
});
|
|
1860
|
-
}
|
|
1861
|
-
function Ee() {
|
|
1862
|
-
z = null;
|
|
1863
|
-
}
|
|
1864
|
-
function V() {
|
|
1865
|
-
B &&= (A.setLook(null, I, Ot), !1);
|
|
1866
|
-
}
|
|
1867
|
-
function De() {
|
|
1868
|
-
if (!Z.get(te())?.baseFace) {
|
|
1869
|
-
V();
|
|
1870
|
-
return;
|
|
1871
|
-
}
|
|
1872
|
-
let e = M?.getBoundingClientRect();
|
|
1873
|
-
if (!e || e.width === 0 || e.height === 0) return;
|
|
1874
|
-
B || (ye = I);
|
|
1875
|
-
let t = Math.max(1, window.innerWidth / 2), n = Math.max(1, window.innerHeight / 2);
|
|
1876
|
-
A.setLook(jt({
|
|
1877
|
-
nx: z ? b((z.x - (e.left + e.width / 2)) / t, -1, 1) : 0,
|
|
1878
|
-
ny: z ? b((z.y - (e.top + e.height / 2)) / n, -1, 1) : 0,
|
|
1879
|
-
tour: S.easeOutQuint(b((I - ye) / Ot)),
|
|
1880
|
-
pointer: z !== null
|
|
1881
|
-
}), I), B = !0;
|
|
1882
|
-
}
|
|
1883
|
-
function H(e) {
|
|
1884
|
-
A.setLook(e(I - Se), I, we);
|
|
1885
|
-
}
|
|
1886
|
-
function Oe() {
|
|
1887
|
-
window.removeEventListener("pointermove", Te), document.removeEventListener("pointerleave", Ee);
|
|
1888
|
-
}
|
|
1889
|
-
function ke(e) {
|
|
1890
|
-
N = requestAnimationFrame(ke);
|
|
1891
|
-
let t = F ? Math.min((e - F) / 1e3, .064) : 0;
|
|
1892
|
-
F = e, I += t;
|
|
1893
|
-
let n = y.fps && y.fps > 0 ? 1 / y.fps : 0;
|
|
1894
|
-
I - pe < n || (pe = I, k() && (I >= P && y.cycle.length ? ge((O() + 1) % y.cycle.length) : ae(I - L)), y.follow ? De() : y.gaze && H(y.gaze), ue(A.sample(I)));
|
|
1895
|
-
}
|
|
1896
|
-
function Ae() {
|
|
1897
|
-
y.frozenAt !== void 0 && ue(A.sample(y.frozenAt));
|
|
1898
|
-
}
|
|
1899
|
-
$(() => y.gaze, (e) => {
|
|
1900
|
-
e ? (Se = I, Ce = !0, A.setLook(e(0), I - we, we)) : Ce &&= (A.setLook(null, I), !1);
|
|
1901
|
-
}), $(O, (e) => {
|
|
1902
|
-
R(e, me), me = 0;
|
|
1903
|
-
}, { defer: !0 }), $(te, (e) => {
|
|
1904
|
-
A.state !== e && (A.setState(e, I), Ae());
|
|
1905
|
-
}, { defer: !0 }), $(k, (e) => {
|
|
1906
|
-
e ? R(O(), ne()) : P = Infinity;
|
|
1907
|
-
}, { defer: !0 }), $(() => y.cycle, (e) => {
|
|
1908
|
-
if (!e.length) {
|
|
1909
|
-
P = Infinity;
|
|
1910
|
-
return;
|
|
1911
|
-
}
|
|
1912
|
-
let t = Math.min(O(), e.length - 1);
|
|
1913
|
-
t === O() ? P = k() ? L + e[t].duration : Infinity : ge(t);
|
|
1914
|
-
}, { defer: !0 }), $(oe, (e) => {
|
|
1915
|
-
A.setShape(e, I), Ae();
|
|
1916
|
-
}, { defer: !0 }), $(ce, (e) => {
|
|
1917
|
-
A.setExpression(e, I), Ae();
|
|
1918
|
-
}, { defer: !0 }), $(() => y.frozenAt, Ae, { defer: !0 }), f(() => y.follow && y.frozenAt === void 0, (e) => {
|
|
1919
|
-
e ? (window.addEventListener("pointermove", Te), document.addEventListener("pointerleave", Ee)) : (Oe(), V());
|
|
1920
|
-
});
|
|
1921
|
-
function U() {
|
|
1922
|
-
N || typeof requestAnimationFrame > "u" || (F = 0, N = requestAnimationFrame(ke));
|
|
1923
|
-
}
|
|
1924
|
-
function W() {
|
|
1925
|
-
N &&= (typeof cancelAnimationFrame < "u" && cancelAnimationFrame(N), 0);
|
|
1926
|
-
}
|
|
1927
|
-
let [je, Me] = m(!0), [Ne, Pe] = m(!0), [Fe, Ie] = m(!1);
|
|
1928
|
-
f(() => Fe() && y.frozenAt === void 0 && (!y.autoPause || je() && Ne()), (e) => {
|
|
1929
|
-
e ? U() : W();
|
|
1930
|
-
}), _(() => {
|
|
1931
|
-
if (l.ref?.({
|
|
1932
|
-
get svg() {
|
|
1933
|
-
return M;
|
|
1934
|
-
},
|
|
1935
|
-
seek: _e,
|
|
1936
|
-
renderAt: ve
|
|
1937
|
-
}), y.frozenAt !== void 0) return;
|
|
1938
|
-
R(O(), ne());
|
|
1939
|
-
let e = () => Pe(document.visibilityState !== "hidden");
|
|
1940
|
-
document.addEventListener("visibilitychange", e), e();
|
|
1941
|
-
let t = typeof IntersectionObserver > "u" ? null : new IntersectionObserver((e) => {
|
|
1942
|
-
let t = e[e.length - 1];
|
|
1943
|
-
t && Me(t.isIntersecting);
|
|
1944
|
-
});
|
|
1945
|
-
return t?.observe(M), Ie(!0), () => {
|
|
1946
|
-
document.removeEventListener("visibilitychange", e), t?.disconnect();
|
|
1947
|
-
};
|
|
1948
|
-
}), g(() => {
|
|
1949
|
-
W(), typeof window < "u" && Oe();
|
|
1950
|
-
});
|
|
1951
|
-
function Le(e) {
|
|
1952
|
-
let t = {
|
|
1953
|
-
fill: e.color ?? (e.depth === void 0 ? se() : Ke(y.paper, se(), e.depth)),
|
|
1954
|
-
opacity: e.opacity
|
|
1955
|
-
};
|
|
1956
|
-
return e.d ? {
|
|
1957
|
-
...t,
|
|
1958
|
-
d: e.d,
|
|
1959
|
-
transform: `translate(${e.x} ${e.y}) rotate(${e.rot ?? 0}) scale(100)`
|
|
1960
|
-
} : {
|
|
1961
|
-
...t,
|
|
1962
|
-
cx: e.x,
|
|
1963
|
-
cy: e.y,
|
|
1964
|
-
r: e.r
|
|
1965
|
-
};
|
|
1966
|
-
}
|
|
1967
|
-
let G = () => n(u, {
|
|
1968
|
-
get each() {
|
|
1969
|
-
return j().dots;
|
|
1970
|
-
},
|
|
1971
|
-
keyed: !1,
|
|
1972
|
-
children: (t) => n(e, a({ get component() {
|
|
1973
|
-
return t().d ? "path" : "circle";
|
|
1974
|
-
} }, () => Le(t())))
|
|
1975
|
-
});
|
|
1976
|
-
var K = tn(), Re = K.firstChild, q = Re.firstChild, ze = q.firstChild, Be = ze.nextSibling, Ue = Be.nextSibling, J = Re.nextSibling, Y = J.nextSibling, qe = Y.firstChild, Je = qe.nextSibling, X = Je.firstChild, Ye = Y.nextSibling, Xe = Ye.nextSibling, Ze = M;
|
|
1977
|
-
return typeof Ze == "function" || Array.isArray(Ze) ? o(() => Ze, K) : M = K, s(K, "viewBox", "-158 -158 316 316"), s(q, "id", fe), s(q, "x", -158), s(q, "y", -158), s(q, "width", 316), s(q, "height", 316), i(q, n(u, {
|
|
1978
|
-
get each() {
|
|
1979
|
-
return j().eyes;
|
|
1980
|
-
},
|
|
1981
|
-
keyed: !1,
|
|
1982
|
-
children: (e) => (() => {
|
|
1983
|
-
var t = nn();
|
|
1984
|
-
return r(() => ({
|
|
1985
|
-
e: e().d,
|
|
1986
|
-
t: e().matrix,
|
|
1987
|
-
a: e().alpha
|
|
1988
|
-
}), ({ e, t: n, a: r }, i) => {
|
|
1989
|
-
e !== i?.e && s(t, "d", e), n !== i?.t && s(t, "transform", n), r !== i?.a && s(t, "opacity", r);
|
|
1990
|
-
}), t;
|
|
1991
|
-
})()
|
|
1992
|
-
}), Be), i(q, n(d, {
|
|
1993
|
-
get when() {
|
|
1994
|
-
return j().notch;
|
|
1995
|
-
},
|
|
1996
|
-
children: (e) => (() => {
|
|
1997
|
-
var t = rn();
|
|
1998
|
-
return r(() => ({
|
|
1999
|
-
e: e().x,
|
|
2000
|
-
t: e().y,
|
|
2001
|
-
a: e().r
|
|
2002
|
-
}), ({ e, t: n, a: r }, i) => {
|
|
2003
|
-
e !== i?.e && s(t, "cx", e), n !== i?.t && s(t, "cy", n), r !== i?.a && s(t, "r", r);
|
|
2004
|
-
}), t;
|
|
2005
|
-
})()
|
|
2006
|
-
}), Ue), i(Re, n(u, {
|
|
2007
|
-
get each() {
|
|
2008
|
-
return j().arcs;
|
|
2009
|
-
},
|
|
2010
|
-
keyed: !1,
|
|
2011
|
-
children: (e) => (() => {
|
|
2012
|
-
var t = an();
|
|
2013
|
-
return i(t, n(u, {
|
|
2014
|
-
get each() {
|
|
2015
|
-
return e().grad.stops;
|
|
2016
|
-
},
|
|
2017
|
-
keyed: !1,
|
|
2018
|
-
children: (t, n) => (() => {
|
|
2019
|
-
var i = on();
|
|
2020
|
-
return r(() => ({
|
|
2021
|
-
e: n / (e().grad.stops.length - 1),
|
|
2022
|
-
t: t()
|
|
2023
|
-
}), ({ e, t }, n) => {
|
|
2024
|
-
e !== n?.e && s(i, "offset", e), t !== n?.t && s(i, "stop-color", t);
|
|
2025
|
-
}), i;
|
|
2026
|
-
})()
|
|
2027
|
-
})), r(() => ({
|
|
2028
|
-
e: `${de}-${e().id}`,
|
|
2029
|
-
t: e().grad.x1,
|
|
2030
|
-
a: e().grad.y1,
|
|
2031
|
-
o: e().grad.x2,
|
|
2032
|
-
i: e().grad.y2
|
|
2033
|
-
}), ({ e, t: n, a: r, o: i, i: a }, o) => {
|
|
2034
|
-
e !== o?.e && s(t, "id", e), n !== o?.t && s(t, "x1", n), r !== o?.a && s(t, "y1", r), i !== o?.o && s(t, "x2", i), a !== o?.i && s(t, "y2", a);
|
|
2035
|
-
}), t;
|
|
2036
|
-
})()
|
|
2037
|
-
}), null), i(J, n(u, {
|
|
2038
|
-
get each() {
|
|
2039
|
-
return j().arcs;
|
|
2040
|
-
},
|
|
2041
|
-
keyed: !1,
|
|
2042
|
-
children: (e) => (() => {
|
|
2043
|
-
var t = sn();
|
|
2044
|
-
return r(() => ({
|
|
2045
|
-
e: e().back,
|
|
2046
|
-
t: `url(#${de}-${e().id})`,
|
|
2047
|
-
a: e().width,
|
|
2048
|
-
o: e().opacity
|
|
2049
|
-
}), ({ e, t: n, a: r, o: i }, a) => {
|
|
2050
|
-
e !== a?.e && s(t, "d", e), n !== a?.t && s(t, "stroke", n), r !== a?.a && s(t, "stroke-width", r), i !== a?.o && s(t, "opacity", i);
|
|
2051
|
-
}), t;
|
|
2052
|
-
})()
|
|
2053
|
-
})), i(K, n(d, {
|
|
2054
|
-
get when() {
|
|
2055
|
-
return j().dotsBehind;
|
|
2056
|
-
},
|
|
2057
|
-
get children() {
|
|
2058
|
-
var e = en();
|
|
2059
|
-
return i(e, n(G, {})), e;
|
|
2060
|
-
}
|
|
2061
|
-
}), J.nextSibling), s(Je, "mask", `url(#${fe})`), s(X, "x", -158), s(X, "y", -158), s(X, "width", 316), s(X, "height", 316), i(K, n(d, {
|
|
2062
|
-
get when() {
|
|
2063
|
-
return !j().dotsBehind;
|
|
2064
|
-
},
|
|
2065
|
-
get children() {
|
|
2066
|
-
var e = en();
|
|
2067
|
-
return i(e, n(G, {})), e;
|
|
2068
|
-
}
|
|
2069
|
-
}), Ye), i(K, n(d, {
|
|
2070
|
-
get when() {
|
|
2071
|
-
return j().notif;
|
|
2072
|
-
},
|
|
2073
|
-
children: (e) => (() => {
|
|
2074
|
-
var t = cn();
|
|
2075
|
-
return s(t, "fill", le), r(() => ({
|
|
2076
|
-
e: e().x,
|
|
2077
|
-
t: e().y,
|
|
2078
|
-
a: e().r
|
|
2079
|
-
}), ({ e, t: n, a: r }, i) => {
|
|
2080
|
-
e !== i?.e && s(t, "cx", e), n !== i?.t && s(t, "cy", n), r !== i?.a && s(t, "r", r);
|
|
2081
|
-
}), t;
|
|
2082
|
-
})()
|
|
2083
|
-
}), Ye.nextSibling), i(Xe, n(u, {
|
|
2084
|
-
get each() {
|
|
2085
|
-
return j().arcs;
|
|
2086
|
-
},
|
|
2087
|
-
keyed: !1,
|
|
2088
|
-
children: (e) => (() => {
|
|
2089
|
-
var t = sn();
|
|
2090
|
-
return r(() => ({
|
|
2091
|
-
e: e().front,
|
|
2092
|
-
t: `url(#${de}-${e().id})`,
|
|
2093
|
-
a: e().width,
|
|
2094
|
-
o: e().opacity
|
|
2095
|
-
}), ({ e, t: n, a: r, o: i }, a) => {
|
|
2096
|
-
e !== a?.e && s(t, "d", e), n !== a?.t && s(t, "stroke", n), r !== a?.a && s(t, "stroke-width", r), i !== a?.o && s(t, "opacity", i);
|
|
2097
|
-
}), t;
|
|
2098
|
-
})()
|
|
2099
|
-
})), r(() => ({
|
|
2100
|
-
e: y.size,
|
|
2101
|
-
t: y.size,
|
|
2102
|
-
a: y.ariaLabel,
|
|
2103
|
-
o: y.class,
|
|
2104
|
-
i: y.style,
|
|
2105
|
-
n: j().bodyPath,
|
|
2106
|
-
s: j().bodyAlpha,
|
|
2107
|
-
h: j().bodyPath,
|
|
2108
|
-
r: y.paper,
|
|
2109
|
-
d: se()
|
|
2110
|
-
}), ({ e, t: n, a: r, o: i, i: a, n: o, s: l, h: u, r: d, d: f }, p) => {
|
|
2111
|
-
e !== p?.e && s(K, "width", e), n !== p?.t && s(K, "height", n), r !== p?.a && s(K, "aria-label", r), t(K, i, p?.o), c(K, a, p?.i), o !== p?.n && s(ze, "d", o), l !== p?.s && s(Y, "opacity", l), u !== p?.h && s(qe, "d", u), d !== p?.r && s(qe, "fill", d), f !== p?.d && s(X, "fill", f);
|
|
2112
|
-
}), K;
|
|
2113
|
-
}
|
|
2114
|
-
//#endregion
|
|
2115
|
-
export { ln as BloubBot, Dt as BotEngine, Ue as COLORS, We as COLOR_BY_ID, Ge as DEFAULT_COLOR, xe as DEFAULT_EXPRESSION, He as DEFAULT_SHAPE, $t as DEMI_VIEWBOX, ye as EXPRESSIONS, be as EXPRESSION_BY_ID, Nt as MAX_BLOCK, Pt as MAX_BLOCS, Ft as MAX_CYCLES, Mt as MIN_BLOCK, nt as POSES, Qt as RAYON, rt as SEQUENCE, Be as SHAPES, Ve as SHAPE_BY_ID, tt as STATES, Z as STATE_BY_ID, It as STEP, kt as TOUR_TIME, Ot as TURN_TIME, Ce as blendExpression, Wt as blockAt, Gt as blocksWith, zt as clampDuration, Vt as defaultCycle, jt as lookTarget, Bt as makeBlock, Rt as minDurationOf, Ke as mixHex, Kt as moveBlock, Jt as nextCycleId, Ut as offsetOf, Zt as parseCycles, Ht as totalDuration, At as tourLook, qt as uniqueName };
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, I as o, L as s, M as c, N as l, O as u, P as d, R as f, S as p, T as m, V as h, _ as g, a as _, b as v, c as y, d as b, f as x, g as S, h as C, i as w, j as T, k as E, l as D, m as O, n as k, o as A, p as j, r as M, s as N, t as P, u as F, v as I, w as L, x as R, y as z, z as B } from "./chunks/BloubBot-_XolrDe1.js";
|
|
2
|
+
export { P as BloubBot, m as BotEngine, T as COLORS, c as COLOR_BY_ID, l as DEFAULT_COLOR, f as DEFAULT_EXPRESSION, d as DEFAULT_SHAPE, k as DEMI_VIEWBOX, B as EXPRESSIONS, t as EXPRESSION_BY_ID, w as MAX_BLOCK, _ as MAX_BLOCS, A as MAX_CYCLES, N as MIN_BLOCK, i as POSES, M as RAYON, r as SEQUENCE, a as SHAPES, o as SHAPE_BY_ID, u as STATES, E as STATE_BY_ID, y as STEP, R as TOUR_TIME, p as TURN_TIME, h as blendExpression, D as blockAt, F as blocksWith, b as clampDuration, x as defaultCycle, e as dotPulse, n as lookTarget, j as makeBlock, O as minDurationOf, s as mixHex, C as moveBlock, S as nextCycleId, g as offsetOf, I as parseCycles, z as totalDuration, L as tourLook, v as uniqueName };
|