wissive 0.1.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.
@@ -0,0 +1,2687 @@
1
+ var et = Object.defineProperty;
2
+ var tt = (o, t, e) => t in o ? et(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
+ var g = (o, t, e) => tt(o, typeof t != "symbol" ? t + "" : t, e);
4
+ function f(o = {}) {
5
+ return {
6
+ eyeOpen: 1,
7
+ eyeScale: 1,
8
+ eyeType: 0,
9
+ eyeGap: 32,
10
+ eyeY: 45,
11
+ mouthY: 63,
12
+ mouthCurve: 0,
13
+ mouthWidth: 0.8,
14
+ mouthOpen: 0,
15
+ mouthType: 0,
16
+ browY: 0,
17
+ browTilt: 0,
18
+ cheek: 0,
19
+ bob: 0,
20
+ shiftX: 0,
21
+ tears: 0,
22
+ gazeX: 0,
23
+ gazeY: 0,
24
+ turnAngle: 0,
25
+ // En 0 por defecto pero SIEMPRE presentes: el resorte solo anima claves
26
+ // que existían en el objeto inicial. Si faltaran aquí, un override
27
+ // procedural (p.ej. "sleeping" poniendo zzz=1) se descartaría en
28
+ // silencio para cualquier emoji que no las trajera ya de fábrica.
29
+ zzz: 0,
30
+ sweat: 0,
31
+ storm: 0,
32
+ scribble: 0,
33
+ puff: 0,
34
+ ...o
35
+ };
36
+ }
37
+ const Re = {
38
+ name: "mochi",
39
+ emotion: "happy",
40
+ baseColor: "#F2A9B8",
41
+ silhouette: "heart",
42
+ motion: {
43
+ stiffness: 220,
44
+ damping: 14,
45
+ idleSpeed: 3.2,
46
+ idleAmplitude: 2.5,
47
+ idleIntervalMin: 6e3,
48
+ idleIntervalMax: 12e3,
49
+ motionType: "bouncy"
50
+ },
51
+ expressions: {
52
+ idle: [
53
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0 }),
54
+ // >‿<
55
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0, bob: -1.5 }),
56
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0, bob: 1 }),
57
+ // ^‿^
58
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0 })
59
+ ],
60
+ near: [
61
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0, bob: -1.5 }),
62
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0, bob: -2.5 })
63
+ ],
64
+ hover: [
65
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0.3, bob: -4 }),
66
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0.3, bob: -4.5 })
67
+ ],
68
+ click: [
69
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0.5, bob: -7 }),
70
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 28.33, eyeY: 43.33, mouthType: 0, mouthY: 53.33, mouthWidth: 0.39, mouthCurve: 0.43, cheek: 0.5, bob: -6 })
71
+ ]
72
+ }
73
+ }, ot = {
74
+ name: "zumi",
75
+ emotion: "flutter",
76
+ baseColor: "#F2CB4E",
77
+ silhouette: "round-blob",
78
+ motion: {
79
+ stiffness: 300,
80
+ damping: 10,
81
+ idleSpeed: 4.5,
82
+ idleAmplitude: 3.8,
83
+ idleIntervalMin: 4e3,
84
+ idleIntervalMax: 9e3,
85
+ motionType: "flutter"
86
+ },
87
+ expressions: {
88
+ idle: [
89
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 30, eyeY: 43.33, mouthType: 3, mouthY: 45.83, mouthWidth: 0.27, mouthCurve: 0, cheek: 0.3 }),
90
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 30, eyeY: 43.33, mouthType: 3, mouthY: 45.83, mouthWidth: 0.27, mouthCurve: 0, cheek: 0.4, bob: -1.5 }),
91
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 30, eyeY: 43.33, mouthType: 3, mouthY: 45.83, mouthWidth: 0.27, mouthCurve: 0, cheek: 0.35, bob: 1 })
92
+ ],
93
+ near: [
94
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 30, eyeY: 43.33, mouthType: 3, mouthY: 45.83, mouthWidth: 0.27, mouthCurve: 0, cheek: 0.5, bob: -2 })
95
+ ],
96
+ hover: [
97
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 30, eyeY: 43.33, mouthType: 3, mouthY: 45.83, mouthWidth: 0.27, mouthCurve: 0, cheek: 0.7, bob: -4 })
98
+ ],
99
+ click: [
100
+ f({ eyeType: 2, eyeScale: 1, eyeGap: 30, eyeY: 43.33, mouthType: 3, mouthY: 45.83, mouthWidth: 0.27, mouthCurve: 0, cheek: 0.9, bob: -6 })
101
+ ]
102
+ }
103
+ }, it = {
104
+ name: "suri",
105
+ emotion: "pleasure",
106
+ baseColor: "#F28FC2",
107
+ silhouette: "elongated-oval",
108
+ motion: {
109
+ stiffness: 140,
110
+ damping: 18,
111
+ idleSpeed: 1.8,
112
+ idleAmplitude: 1.8,
113
+ idleIntervalMin: 7e3,
114
+ idleIntervalMax: 14e3,
115
+ motionType: "serene"
116
+ },
117
+ expressions: {
118
+ idle: [
119
+ f({ eyeType: 1, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 0, mouthY: 53.33, mouthWidth: 0.36, mouthCurve: 0.48, cheek: 0.4 }),
120
+ f({ eyeType: 1, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 0, mouthY: 53.33, mouthWidth: 0.36, mouthCurve: 0.48, cheek: 0.5, bob: 1 })
121
+ ],
122
+ near: [
123
+ f({ eyeType: 1, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 0, mouthY: 53.33, mouthWidth: 0.36, mouthCurve: 0.48, cheek: 0.6, bob: 2 })
124
+ ],
125
+ hover: [
126
+ f({ eyeType: 1, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 0, mouthY: 53.33, mouthWidth: 0.36, mouthCurve: 0.48, cheek: 0.75, bob: 3.5 })
127
+ ],
128
+ click: [
129
+ f({ eyeType: 1, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 0, mouthY: 53.33, mouthWidth: 0.36, mouthCurve: 0.48, cheek: 0.9, bob: 5 })
130
+ ]
131
+ }
132
+ }, st = {
133
+ name: "nima",
134
+ emotion: "peaceful",
135
+ baseColor: "#9AC9A0",
136
+ silhouette: "ghost-blob",
137
+ motion: {
138
+ stiffness: 110,
139
+ damping: 22,
140
+ idleSpeed: 1.2,
141
+ idleAmplitude: 2,
142
+ idleIntervalMin: 8e3,
143
+ idleIntervalMax: 15e3,
144
+ motionType: "float"
145
+ },
146
+ expressions: {
147
+ idle: [
148
+ f({ eyeType: 14, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 14, mouthY: 51.67, mouthWidth: 0, mouthCurve: 0 }),
149
+ f({ eyeType: 14, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 14, mouthY: 51.67, mouthWidth: 0, mouthCurve: 0, bob: 1.5 })
150
+ ],
151
+ near: [
152
+ f({ eyeType: 14, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 14, mouthY: 51.67, mouthWidth: 0, mouthCurve: 0, bob: 2 })
153
+ ],
154
+ hover: [
155
+ f({ eyeType: 14, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 14, mouthY: 51.67, mouthWidth: 0, mouthCurve: 0, cheek: 0.3, bob: 3 })
156
+ ],
157
+ click: [
158
+ f({ eyeType: 14, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 14, mouthY: 51.67, mouthWidth: 0, mouthCurve: 0, cheek: 0.5, bob: 4.5 })
159
+ ]
160
+ }
161
+ }, Ce = {
162
+ name: "cota",
163
+ emotion: "normal",
164
+ baseColor: "#C9DCD3",
165
+ silhouette: "oval",
166
+ motion: {
167
+ stiffness: 160,
168
+ damping: 18,
169
+ idleSpeed: 1.5,
170
+ idleAmplitude: 1.2,
171
+ idleIntervalMin: 8e3,
172
+ idleIntervalMax: 16e3,
173
+ motionType: "calm"
174
+ },
175
+ expressions: {
176
+ idle: [
177
+ f({ eyeType: 0, eyeScale: 1, eyeGap: 23.33, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0 }),
178
+ f({ eyeType: 0, eyeScale: 1, eyeGap: 23.33, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, bob: -0.8 })
179
+ ],
180
+ near: [
181
+ f({ eyeType: 0, eyeScale: 1, eyeGap: 23.33, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, bob: 1.2 })
182
+ ],
183
+ hover: [
184
+ f({ eyeType: 0, eyeScale: 1, eyeGap: 23.33, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, cheek: 0.2, bob: 2.5 })
185
+ ],
186
+ click: [
187
+ f({ eyeType: 0, eyeScale: 1, eyeGap: 23.33, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, cheek: 0.4, bob: 4 })
188
+ ]
189
+ }
190
+ }, at = {
191
+ name: "dozy",
192
+ emotion: "tired",
193
+ baseColor: "#D6DBCF",
194
+ silhouette: "wide-oval",
195
+ motion: {
196
+ stiffness: 90,
197
+ damping: 24,
198
+ idleSpeed: 0.9,
199
+ idleAmplitude: 2.8,
200
+ idleIntervalMin: 6e3,
201
+ idleIntervalMax: 12e3,
202
+ motionType: "droop"
203
+ },
204
+ expressions: {
205
+ // Cansado de verdad: párpados caídos + gotas de sudor + resoplido —
206
+ // sin zzz, que es "dormido"; Dozy está agotado pero despierto.
207
+ idle: [
208
+ f({ eyeType: 15, eyeScale: 0.85, eyeGap: 26.67, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.24, mouthCurve: 0, sweat: 1, puff: 0.7, bob: 1.5 }),
209
+ f({ eyeType: 15, eyeScale: 0.85, eyeGap: 26.67, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.24, mouthCurve: 0, sweat: 1, puff: 0.7, bob: 2.5 })
210
+ ],
211
+ near: [
212
+ f({ eyeType: 15, eyeScale: 0.85, eyeGap: 26.67, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.24, mouthCurve: 0, sweat: 1, puff: 0.7, bob: 3.5 })
213
+ ],
214
+ hover: [
215
+ f({ eyeType: 15, eyeScale: 0.85, eyeGap: 26.67, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.24, mouthCurve: 0, sweat: 1, puff: 0.85, bob: 4.5 })
216
+ ],
217
+ click: [
218
+ f({ eyeType: 15, eyeScale: 0.85, eyeGap: 26.67, eyeY: 45.83, mouthType: 3, mouthY: 56.67, mouthWidth: 0.24, mouthCurve: 0, sweat: 1, puff: 1, bob: 6.5 })
219
+ ]
220
+ }
221
+ }, nt = {
222
+ name: "lumo",
223
+ emotion: "sad",
224
+ baseColor: "#7FA6D9",
225
+ silhouette: "teardrop-blob",
226
+ motion: {
227
+ stiffness: 100,
228
+ damping: 20,
229
+ idleSpeed: 1.1,
230
+ idleAmplitude: 2.2,
231
+ idleIntervalMin: 7e3,
232
+ idleIntervalMax: 13e3,
233
+ motionType: "sob"
234
+ },
235
+ expressions: {
236
+ idle: [
237
+ f({ eyeType: 16, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 3, mouthY: 55, mouthWidth: 0.3, mouthCurve: 0, tears: 1, bob: 1.8 }),
238
+ f({ eyeType: 16, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 3, mouthY: 55, mouthWidth: 0.3, mouthCurve: 0, tears: 1, bob: 2.8 })
239
+ ],
240
+ near: [
241
+ f({ eyeType: 16, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 3, mouthY: 55, mouthWidth: 0.3, mouthCurve: 0, tears: 1, bob: 3.5 })
242
+ ],
243
+ hover: [
244
+ f({ eyeType: 16, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 3, mouthY: 55, mouthWidth: 0.3, mouthCurve: 0, tears: 1, bob: 4.8 })
245
+ ],
246
+ click: [
247
+ f({ eyeType: 16, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 3, mouthY: 55, mouthWidth: 0.3, mouthCurve: 0, tears: 1, bob: 6 })
248
+ ]
249
+ }
250
+ }, rt = {
251
+ name: "fidge",
252
+ emotion: "anxiety",
253
+ baseColor: "#A99BD9",
254
+ silhouette: "cloud-blob",
255
+ motion: {
256
+ stiffness: 350,
257
+ damping: 8,
258
+ idleSpeed: 5.5,
259
+ idleAmplitude: 1.5,
260
+ idleIntervalMin: 3e3,
261
+ idleIntervalMax: 7e3,
262
+ motionType: "jitter"
263
+ },
264
+ expressions: {
265
+ idle: [
266
+ f({ eyeType: 5, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 13, mouthY: 56.67, mouthWidth: 0.08, mouthCurve: 0 }),
267
+ f({ eyeType: 5, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 13, mouthY: 56.67, mouthWidth: 0.08, mouthCurve: 0, shiftX: 1.5 })
268
+ ],
269
+ near: [
270
+ f({ eyeType: 5, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 13, mouthY: 56.67, mouthWidth: 0.08, mouthCurve: 0, shiftX: 2.5 })
271
+ ],
272
+ hover: [
273
+ f({ eyeType: 5, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 13, mouthY: 56.67, mouthWidth: 0.08, mouthCurve: 0, shiftX: 4 })
274
+ ],
275
+ click: [
276
+ f({ eyeType: 5, eyeScale: 1, eyeGap: 25, eyeY: 43.33, mouthType: 13, mouthY: 56.67, mouthWidth: 0.08, mouthCurve: 0, shiftX: 6 })
277
+ ]
278
+ }
279
+ }, lt = {
280
+ name: "brix",
281
+ emotion: "anger",
282
+ baseColor: "#D9566A",
283
+ silhouette: "flame-blob",
284
+ motion: {
285
+ stiffness: 280,
286
+ damping: 12,
287
+ idleSpeed: 3.8,
288
+ idleAmplitude: 2,
289
+ idleIntervalMin: 4e3,
290
+ idleIntervalMax: 8e3,
291
+ motionType: "fiery"
292
+ },
293
+ expressions: {
294
+ idle: [
295
+ f({ eyeType: 17, eyeScale: 1, eyeGap: 28.33, eyeY: 46.67, mouthType: 0, mouthY: 61.67, mouthWidth: 0.33, mouthCurve: -0.48 }),
296
+ f({ eyeType: 17, eyeScale: 1, eyeGap: 28.33, eyeY: 46.67, mouthType: 0, mouthY: 61.67, mouthWidth: 0.33, mouthCurve: -0.48 })
297
+ ],
298
+ near: [
299
+ f({ eyeType: 17, eyeScale: 1, eyeGap: 28.33, eyeY: 46.67, mouthType: 0, mouthY: 61.67, mouthWidth: 0.33, mouthCurve: -0.48 })
300
+ ],
301
+ hover: [
302
+ f({ eyeType: 17, eyeScale: 1, eyeGap: 28.33, eyeY: 46.67, mouthType: 0, mouthY: 61.67, mouthWidth: 0.33, mouthCurve: -0.48 })
303
+ ],
304
+ click: [
305
+ f({ eyeType: 17, eyeScale: 1, eyeGap: 28.33, eyeY: 46.67, mouthType: 0, mouthY: 61.67, mouthWidth: 0.33, mouthCurve: -0.48 })
306
+ ]
307
+ }
308
+ }, ct = {
309
+ name: "wilt",
310
+ emotion: "disappointed",
311
+ baseColor: "#EBD98A",
312
+ silhouette: "droopy-blob",
313
+ motion: {
314
+ stiffness: 100,
315
+ damping: 22,
316
+ idleSpeed: 1,
317
+ idleAmplitude: 2,
318
+ idleIntervalMin: 7e3,
319
+ idleIntervalMax: 14e3,
320
+ motionType: "wilt"
321
+ },
322
+ expressions: {
323
+ idle: [
324
+ f({ eyeType: 15, eyeScale: 1.15, eyeGap: 25, eyeY: 43.33, mouthType: 0, mouthY: 63.33, mouthWidth: 0.45, mouthCurve: -0.54, bob: 1.5 }),
325
+ f({ eyeType: 15, eyeScale: 1.15, eyeGap: 25, eyeY: 43.33, mouthType: 0, mouthY: 63.33, mouthWidth: 0.45, mouthCurve: -0.54, bob: 2.5 })
326
+ ],
327
+ near: [
328
+ f({ eyeType: 15, eyeScale: 1.15, eyeGap: 25, eyeY: 43.33, mouthType: 0, mouthY: 63.33, mouthWidth: 0.45, mouthCurve: -0.54, bob: 3.5 })
329
+ ],
330
+ hover: [
331
+ f({ eyeType: 15, eyeScale: 1.15, eyeGap: 25, eyeY: 43.33, mouthType: 0, mouthY: 63.33, mouthWidth: 0.45, mouthCurve: -0.54, bob: 4.5 })
332
+ ],
333
+ click: [
334
+ f({ eyeType: 15, eyeScale: 1.15, eyeGap: 25, eyeY: 43.33, mouthType: 0, mouthY: 63.33, mouthWidth: 0.45, mouthCurve: -0.54, bob: 6 })
335
+ ]
336
+ }
337
+ }, ht = {
338
+ name: "knot",
339
+ emotion: "stress",
340
+ baseColor: "#C97F76",
341
+ silhouette: "bear-blob",
342
+ motion: {
343
+ stiffness: 320,
344
+ damping: 9,
345
+ idleSpeed: 4.8,
346
+ idleAmplitude: 2.2,
347
+ idleIntervalMin: 3500,
348
+ idleIntervalMax: 7500,
349
+ motionType: "dizzy"
350
+ },
351
+ expressions: {
352
+ // Estresado de verdad: la espiral de mareo en los ojos ya lo insinuaba,
353
+ // pero el sello de Knot es cargar con la nube de tormenta Y el garabato
354
+ // de confusión encima a la vez — agobiado por todos lados, no solo mareado.
355
+ idle: [
356
+ f({ eyeType: 18, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 58.33, mouthWidth: 0.42, mouthCurve: 0, storm: 1, scribble: 1 }),
357
+ f({ eyeType: 18, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 58.33, mouthWidth: 0.42, mouthCurve: 0, storm: 1, scribble: 1, shiftX: 1.5 })
358
+ ],
359
+ near: [
360
+ f({ eyeType: 18, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 58.33, mouthWidth: 0.42, mouthCurve: 0, storm: 1, scribble: 1, shiftX: 3 })
361
+ ],
362
+ hover: [
363
+ f({ eyeType: 18, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 58.33, mouthWidth: 0.42, mouthCurve: 0, storm: 1, scribble: 1, shiftX: 4.5 })
364
+ ],
365
+ click: [
366
+ f({ eyeType: 18, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 58.33, mouthWidth: 0.42, mouthCurve: 0, storm: 1, scribble: 1, shiftX: 6.5 })
367
+ ]
368
+ }
369
+ }, ut = {
370
+ name: "snug",
371
+ emotion: "sleepy",
372
+ baseColor: "#AFCBE0",
373
+ silhouette: "soft-round",
374
+ motion: {
375
+ stiffness: 85,
376
+ damping: 25,
377
+ idleSpeed: 0.7,
378
+ idleAmplitude: 2.2,
379
+ idleIntervalMin: 6e3,
380
+ idleIntervalMax: 12e3,
381
+ motionType: "snooze"
382
+ },
383
+ expressions: {
384
+ idle: [
385
+ f({ eyeType: 19, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 56.67, mouthWidth: 0.27, mouthCurve: 0, zzz: 1, bob: 0.5 }),
386
+ f({ eyeType: 19, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 56.67, mouthWidth: 0.27, mouthCurve: 0, zzz: 1, bob: 1.5 })
387
+ ],
388
+ near: [
389
+ f({ eyeType: 19, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 56.67, mouthWidth: 0.27, mouthCurve: 0, zzz: 1, bob: 2.5 })
390
+ ],
391
+ hover: [
392
+ f({ eyeType: 19, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 56.67, mouthWidth: 0.27, mouthCurve: 0, zzz: 1, bob: 3.8 })
393
+ ],
394
+ click: [
395
+ f({ eyeType: 19, eyeScale: 1, eyeGap: 26.67, eyeY: 45, mouthType: 3, mouthY: 56.67, mouthWidth: 0.27, mouthCurve: 0, zzz: 1, bob: 5.5 })
396
+ ]
397
+ }
398
+ }, dt = {
399
+ name: "pip",
400
+ emotion: "surprised",
401
+ baseColor: "#F0B98A",
402
+ silhouette: "octopus-blob",
403
+ motion: {
404
+ stiffness: 250,
405
+ damping: 12,
406
+ idleSpeed: 2.8,
407
+ idleAmplitude: 3,
408
+ idleIntervalMin: 5e3,
409
+ idleIntervalMax: 1e4,
410
+ motionType: "pop"
411
+ },
412
+ expressions: {
413
+ idle: [
414
+ f({ eyeType: 20, eyeScale: 0.8, eyeGap: 21.67, eyeY: 43.33, mouthType: 1, mouthY: 55, mouthWidth: 0.21, mouthCurve: 0 }),
415
+ f({ eyeType: 20, eyeScale: 0.8, eyeGap: 21.67, eyeY: 43.33, mouthType: 1, mouthY: 55, mouthWidth: 0.21, mouthCurve: 0, bob: -2 })
416
+ ],
417
+ near: [
418
+ f({ eyeType: 20, eyeScale: 0.8, eyeGap: 21.67, eyeY: 43.33, mouthType: 1, mouthY: 55, mouthWidth: 0.21, mouthCurve: 0, bob: -3 })
419
+ ],
420
+ hover: [
421
+ f({ eyeType: 20, eyeScale: 0.8, eyeGap: 21.67, eyeY: 43.33, mouthType: 1, mouthY: 55, mouthWidth: 0.21, mouthCurve: 0, bob: -5 })
422
+ ],
423
+ click: [
424
+ f({ eyeType: 20, eyeScale: 0.8, eyeGap: 21.67, eyeY: 43.33, mouthType: 1, mouthY: 55, mouthWidth: 0.21, mouthCurve: 0, bob: -8 })
425
+ ]
426
+ }
427
+ }, mt = {
428
+ name: "void",
429
+ emotion: "numbness",
430
+ baseColor: "#D9C6E0",
431
+ silhouette: "wave-blob",
432
+ motion: {
433
+ stiffness: 100,
434
+ damping: 24,
435
+ idleSpeed: 0.8,
436
+ idleAmplitude: 1.5,
437
+ idleIntervalMin: 9e3,
438
+ idleIntervalMax: 18e3,
439
+ motionType: "drift"
440
+ },
441
+ expressions: {
442
+ idle: [
443
+ f({ eyeType: 20, eyeScale: 0.75, eyeGap: 23.33, eyeY: 44.17, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0 }),
444
+ f({ eyeType: 20, eyeScale: 0.75, eyeGap: 23.33, eyeY: 44.17, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, bob: 1 })
445
+ ],
446
+ near: [
447
+ f({ eyeType: 20, eyeScale: 0.75, eyeGap: 23.33, eyeY: 44.17, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, bob: 2 })
448
+ ],
449
+ hover: [
450
+ f({ eyeType: 20, eyeScale: 0.75, eyeGap: 23.33, eyeY: 44.17, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, bob: 3 })
451
+ ],
452
+ click: [
453
+ f({ eyeType: 20, eyeScale: 0.75, eyeGap: 23.33, eyeY: 44.17, mouthType: 3, mouthY: 56.67, mouthWidth: 0.33, mouthCurve: 0, bob: 4.5 })
454
+ ]
455
+ }
456
+ }, oe = {
457
+ mochi: Re,
458
+ zumi: ot,
459
+ suri: it,
460
+ nima: st,
461
+ cota: Ce,
462
+ dozy: at,
463
+ lumo: nt,
464
+ fidge: rt,
465
+ brix: lt,
466
+ wilt: ct,
467
+ knot: ht,
468
+ snug: ut,
469
+ pip: dt,
470
+ void: mt
471
+ };
472
+ function We(o) {
473
+ const t = o.toLowerCase();
474
+ return oe[t] ? oe[t] : Object.values(oe).find((i) => i.emotion === t) || Re;
475
+ }
476
+ function yt(o, t = {}) {
477
+ const { stiffness: e = 180, damping: i = 18, mass: n = 1 } = t, c = {
478
+ current: o,
479
+ target: o,
480
+ velocity: 0
481
+ };
482
+ return {
483
+ state: c,
484
+ setTarget(a) {
485
+ c.target = a;
486
+ },
487
+ setCurrent(a) {
488
+ c.current = a, c.target = a, c.velocity = 0;
489
+ },
490
+ update(a) {
491
+ const $ = a / 4;
492
+ let b = !1;
493
+ for (let d = 0; d < 4; d++) {
494
+ const M = c.current - c.target, v = -e * M, Y = -i * c.velocity, A = (v + Y) / n;
495
+ c.velocity += A * $, c.current += c.velocity * $, (Math.abs(c.velocity) > 1e-4 || Math.abs(c.current - c.target) > 1e-4) && (b = !0);
496
+ }
497
+ return b || (c.current = c.target, c.velocity = 0), b;
498
+ }
499
+ };
500
+ }
501
+ function ft(o, t) {
502
+ const e = Object.keys(o), i = {};
503
+ for (const n of e)
504
+ i[n] = yt(o[n], t);
505
+ return {
506
+ getValues() {
507
+ const n = {};
508
+ for (const c of e)
509
+ n[c] = i[c].state.current;
510
+ return n;
511
+ },
512
+ setTargets(n) {
513
+ for (const c in n)
514
+ c in i && i[c].setTarget(n[c]);
515
+ },
516
+ setValues(n) {
517
+ for (const c in n)
518
+ c in i && i[c].setCurrent(n[c]);
519
+ },
520
+ update(n) {
521
+ let c = !1;
522
+ for (const a of e)
523
+ i[a].update(n) && (c = !0);
524
+ return c;
525
+ }
526
+ };
527
+ }
528
+ function pt(o, t) {
529
+ const e = { ...o };
530
+ switch (t) {
531
+ case "sleeping":
532
+ e.eyeOpen = 0.05, e.eyeType = 2, e.mouthCurve = 0.2, e.browY = 3, e.browTilt = -0.1, e.cheek = 0.2, e.zzz = 1;
533
+ break;
534
+ case "drowsy":
535
+ case "powering-down":
536
+ e.eyeOpen = 0.35, e.mouthCurve = 0, e.browY = 4, e.browTilt = 0.1, e.zzz = 0.55, e.sweat = 0.8, e.puff = 0.7;
537
+ break;
538
+ case "bored":
539
+ e.eyeOpen = 0.45, e.mouthCurve = -0.2, e.browY = 2, e.gazeX = 6, e.puff = 0.4;
540
+ break;
541
+ case "waking":
542
+ case "spawning":
543
+ e.eyeOpen = 0.75, e.eyeScale = 1.1, e.mouthCurve = 0.4, e.browY = -2;
544
+ break;
545
+ case "angry":
546
+ e.eyeType = 3, e.browTilt = -0.75, e.mouthCurve = -0.65, e.mouthOpen = 0.2, e.eyeScale = 1.15, e.storm = 1;
547
+ break;
548
+ case "alerting":
549
+ case "notifying":
550
+ e.eyeScale = 1.3, e.browTilt = -0.4, e.mouthOpen = 0.45, e.mouthCurve = 0.1;
551
+ break;
552
+ case "suspicious":
553
+ e.browTilt = -0.5, e.eyeScale = 0.9, e.mouthCurve = -0.3, e.gazeX = -8;
554
+ break;
555
+ case "excited":
556
+ case "celebrate":
557
+ e.eyeScale = 1.35, e.mouthCurve = 0.9, e.mouthOpen = 0.55, e.cheek = 0.85, e.browY = -4;
558
+ break;
559
+ case "happy":
560
+ case "playful":
561
+ e.eyeScale = 1.15, e.mouthCurve = 0.75, e.cheek = 0.6, e.browY = -2;
562
+ break;
563
+ case "laughing":
564
+ e.eyeType = 2, e.mouthCurve = 0.95, e.mouthOpen = 0.7, e.cheek = 0.9, e.bob = -3;
565
+ break;
566
+ case "proud":
567
+ e.eyeScale = 1.1, e.mouthCurve = 0.65, e.browY = -3, e.bob = -4;
568
+ break;
569
+ case "thinking":
570
+ case "searching":
571
+ e.browTilt = 0.5, e.eyeScale = 1.1, e.mouthWidth = 0.6, e.mouthCurve = 0.1, e.shiftX = -4;
572
+ break;
573
+ case "dictating":
574
+ case "listening":
575
+ case "writing":
576
+ case "humming":
577
+ e.mouthOpen = 0.45, e.mouthCurve = 0.4, e.eyeScale = 1.08, e.cheek = 0.4;
578
+ break;
579
+ case "loading":
580
+ case "orbit":
581
+ case "radar":
582
+ case "progress":
583
+ e.eyeScale = 1.15, e.mouthCurve = 0.3, e.browY = -2;
584
+ break;
585
+ case "surprised":
586
+ e.eyeScale = 1.45, e.mouthOpen = 0.75, e.mouthCurve = 0, e.browY = -7;
587
+ break;
588
+ case "scared":
589
+ e.eyeScale = 1.4, e.mouthOpen = 0.8, e.mouthCurve = -0.55, e.browTilt = 0.5;
590
+ break;
591
+ case "confused":
592
+ e.browTilt = 0.65, e.mouthCurve = -0.3, e.shiftX = -5, e.scribble = 1;
593
+ break;
594
+ case "curious":
595
+ e.browTilt = -0.3, e.eyeScale = 1.2, e.mouthCurve = 0.45, e.shiftX = 3;
596
+ break;
597
+ case "shy":
598
+ e.eyeScale = 0.85, e.gazeY = 6, e.cheek = 0.95, e.mouthCurve = 0.35;
599
+ break;
600
+ case "sad":
601
+ e.browTilt = 0.6, e.mouthCurve = -0.65, e.tears = 0.8, e.browY = 2;
602
+ break;
603
+ }
604
+ return e;
605
+ }
606
+ class $t {
607
+ constructor() {
608
+ g(this, "currentState", "idle");
609
+ g(this, "lastIndices", {});
610
+ }
611
+ getState() {
612
+ return this.currentState;
613
+ }
614
+ setState(t) {
615
+ const e = this.currentState !== t;
616
+ return this.currentState = t, e;
617
+ }
618
+ resolvePool(t, e = this.currentState) {
619
+ let i = [];
620
+ if (t[e] && t[e].length > 0)
621
+ i = t[e];
622
+ else
623
+ switch (e) {
624
+ case "happy":
625
+ case "excited":
626
+ case "playful":
627
+ case "celebrate":
628
+ case "laughing":
629
+ case "proud":
630
+ i = t.hover || t.idle;
631
+ break;
632
+ case "surprised":
633
+ case "scared":
634
+ case "alerting":
635
+ case "notifying":
636
+ case "bouncing":
637
+ i = t.click || t.hover || t.idle;
638
+ break;
639
+ case "suspicious":
640
+ case "angry":
641
+ i = t.click || t.idle;
642
+ break;
643
+ case "curious":
644
+ case "thinking":
645
+ case "searching":
646
+ case "listening":
647
+ case "working":
648
+ case "confused":
649
+ case "shy":
650
+ case "sad":
651
+ case "dictating":
652
+ case "writing":
653
+ case "sending":
654
+ case "receiving":
655
+ case "uploading":
656
+ case "dragging":
657
+ case "humming":
658
+ case "loading":
659
+ case "orbit":
660
+ case "radar":
661
+ case "progress":
662
+ i = t.near || t.hover || t.idle;
663
+ break;
664
+ default:
665
+ i = t[e] || t.idle;
666
+ break;
667
+ }
668
+ return i.map((n) => pt(n, e));
669
+ }
670
+ pickVariant(t, e = this.currentState) {
671
+ if (!t || t.length === 0)
672
+ throw new Error(`Empty variant pool for state "${e}"`);
673
+ if (t.length === 1)
674
+ return this.lastIndices[e] = 0, t[0];
675
+ const i = this.lastIndices[e] ?? -1;
676
+ let n = Math.floor(Math.random() * t.length);
677
+ for (; n === i; )
678
+ n = Math.floor(Math.random() * t.length);
679
+ return this.lastIndices[e] = n, t[n];
680
+ }
681
+ }
682
+ class bt {
683
+ constructor() {
684
+ g(this, "callbacks", /* @__PURE__ */ new Set());
685
+ g(this, "handle", null);
686
+ g(this, "lastTime", 0);
687
+ }
688
+ add(t) {
689
+ this.callbacks.add(t), this.handle || (this.lastTime = performance.now(), this.tick = this.tick.bind(this), this.handle = requestAnimationFrame(this.tick));
690
+ }
691
+ remove(t) {
692
+ this.callbacks.delete(t), this.callbacks.size === 0 && this.handle !== null && (cancelAnimationFrame(this.handle), this.handle = null);
693
+ }
694
+ get size() {
695
+ return this.callbacks.size;
696
+ }
697
+ tick(t) {
698
+ const e = Math.min((t - this.lastTime) / 1e3, 0.1);
699
+ this.lastTime = t, this.callbacks.forEach((i) => i(e)), this.callbacks.size > 0 ? this.handle = requestAnimationFrame(this.tick) : this.handle = null;
700
+ }
701
+ }
702
+ const O = new bt();
703
+ function Ne(o = 2.2, t = 0.25) {
704
+ const e = [], i = o * Math.PI * 2;
705
+ for (let n = 0; n <= i; n += t) {
706
+ const c = n / i;
707
+ e.push([Math.cos(n) * c, Math.sin(n) * c]);
708
+ }
709
+ return e;
710
+ }
711
+ function gt(o) {
712
+ switch (o) {
713
+ case "circle":
714
+ return "M 50 13 A 37 37 0 1 0 50 87 A 37 37 0 1 0 50 13 Z";
715
+ case "heart":
716
+ return "M 50 21.67 C 54.17 17.5 65 12.5 74.17 16.67 C 85 21.67 89.17 35.83 85 48.33 C 80.83 61.67 66.67 74.17 50 74.17 C 33.33 74.17 19.17 61.67 15 48.33 C 10.83 35.83 15 21.67 25.83 16.67 C 35 12.5 45.83 17.5 50 21.67 Z";
717
+ case "capsule":
718
+ return "M 26 26 L 74 26 C 88 26 88 74 74 74 L 26 74 C 12 74 12 26 26 26 Z";
719
+ case "rounded-squircle":
720
+ return "M 32 18 L 68 18 C 84 18 84 32 84 50 C 84 68 84 82 68 82 L 32 82 C 16 82 16 68 16 50 C 16 32 16 18 32 18 Z";
721
+ case "pear-blob":
722
+ return "M 50 14 C 66 14 72 32 80 54 C 86 70 80 86 50 86 C 20 86 14 70 20 54 C 28 32 34 14 50 14 Z";
723
+ case "egg-oval":
724
+ return "M 18 54 C 18 26 32 14 50 14 C 68 14 82 26 82 54 C 82 74 70 84 50 84 C 30 84 18 74 18 54 Z";
725
+ case "starburst-puff":
726
+ return "M 34 18 C 50 24 50 24 66 18 C 78 18 84 30 80 46 C 84 62 78 82 66 82 C 50 76 50 76 34 82 C 22 82 16 62 20 46 C 16 30 22 18 34 18 Z";
727
+ case "pill-vertical":
728
+ return "M 26 28 C 26 12 74 12 74 28 L 74 72 C 74 88 26 88 26 72 Z";
729
+ case "round-blob":
730
+ return "M 86.5 53.64 C 86.5 73.98 70.16 77.2 50 77.2 C 29.84 77.2 13.5 73.98 13.5 53.64 C 13.5 33.29 29.84 16.8 50 16.8 C 70.16 16.8 86.5 33.29 86.5 53.64 Z";
731
+ case "ghost-blob":
732
+ return "M 50 14.17 C 70 14.17 83.33 29.17 83.33 47.5 L 83.33 70 C 83.33 75 78.33 75.83 75.83 71.67 C 73.33 65.83 67.5 65.83 65 71.67 C 62.5 77.5 56.67 77.5 54.17 71.67 C 51.67 65.83 45.83 65.83 43.33 71.67 C 40.83 77.5 35 77.5 32.5 71.67 C 30 65.83 24.17 65.83 21.67 71.67 C 19.17 75.83 16.67 75 16.67 70 L 16.67 47.5 C 16.67 29.17 30 14.17 50 14.17 Z";
733
+ case "oval":
734
+ return "M 45.24 12.83 C 58.45 10.98 74.32 28.1 76.87 46.26 C 79.31 63.59 69.61 78.41 54.76 80.5 C 39.9 82.59 26.49 71.01 24.06 53.68 C 21.51 35.52 32.04 14.69 45.24 12.83 Z";
735
+ case "elongated-oval":
736
+ return "M 86.38 54.82 C 87.03 78.56 86.38 75.48 49.94 76.67 C 13.52 77.86 13.5 75.67 13.5 54.82 C 13.5 33.97 29.81 17.07 49.94 17.07 C 70.06 17.07 86.38 33.97 86.38 54.82 Z";
737
+ case "teardrop-blob":
738
+ return "M 50 14.17 C 70 14.17 84.17 28.33 84.17 47.5 C 84.17 69.17 69.17 81.67 49.17 81.67 C 30 81.67 15.83 68.33 15.83 47.5 C 15.83 28.33 30 14.17 50 14.17 Z";
739
+ case "flame-blob":
740
+ return "M 20 43.33 L 25.83 18.33 L 36.67 35 L 47.5 13.33 L 58.33 33.33 L 70 20 L 75.83 43.33 C 82.5 51.67 80 65.83 70 74.17 C 58.33 83.33 38.33 81.67 27.5 72.5 C 18.33 65 14.17 51.67 20 43.33 Z";
741
+ case "droopy-blob":
742
+ return "M 47.83 15.03 C 64.86 12.2 79.26 26.85 79.26 43.84 C 79.26 62.72 77.35 73.65 59.63 78.17 C 41.9 82.69 18.53 73.61 19.16 56.42 C 19.16 33.97 20.59 24.37 35.7 17.57 C 39.66 15.66 43.78 15.72 47.83 15.03 Z M 13.5 49.19 A 6.92 6.92 0 1 0 27.34 49.19 A 6.92 6.92 0 1 0 13.5 49.19 Z M 72.66 49.19 A 6.92 6.92 0 1 0 86.5 49.19 A 6.92 6.92 0 1 0 72.66 49.19 Z";
743
+ case "bear-blob":
744
+ return "M 85.2 51.24 C 85.2 71.22 69.15 78.94 49.35 78.94 C 29.55 78.94 13.5 71.22 13.5 51.24 C 13.5 31.26 29.55 15.06 49.35 15.06 C 69.15 15.06 85.2 31.26 85.2 51.24 Z M 86.5 29.08 C 86.5 34.3 81.98 38.53 76.4 38.53 C 70.82 38.53 66.29 34.3 66.29 29.08 C 66.29 23.86 70.82 19.63 76.4 19.63 C 81.98 19.63 86.5 23.86 86.5 29.08 Z M 13.5 29.08 A 10.1 9.45 0 1 0 33.7 29.08 A 10.1 9.45 0 1 0 13.5 29.08 Z";
745
+ case "spiky-blob":
746
+ return "M 50 12 C 76 12 88 26 88 48 C 88 64 88 78 84 86 C 78 82 72 92 64 86 C 56 82 50 90 44 86 C 36 92 30 82 12 48 C 12 26 24 12 50 12 Z";
747
+ case "cloud-blob":
748
+ return "M 50 12.5 C 60 9.17 69.17 15.83 71.67 21.67 C 79.17 24.17 83.33 32.5 80.83 40 C 85.83 47.5 83.33 57.5 78.33 61.67 C 76.67 70.83 68.33 76.67 60 74.17 C 53.33 80 42.5 80 35.83 74.17 C 27.5 76.67 20 70 18.33 61.67 C 13.33 56.67 11.67 47.5 16.67 40 C 14.17 32.5 20 24.17 27.5 21.67 C 30.83 15 40 9.17 50 12.5 Z";
749
+ case "wide-oval":
750
+ return "M 50 20.83 C 73.33 20.83 87.5 31.67 87.5 47.5 C 87.5 64.17 73.33 75.83 50 75.83 C 26.67 75.83 12.5 64.17 12.5 47.5 C 12.5 31.67 26.67 20.83 50 20.83 Z";
751
+ case "soft-round":
752
+ return "M 50 15 C 73.33 15 85 26.67 85 48.33 C 85 70 73.33 80 50 80 C 26.67 80 15 70 15 48.33 C 15 26.67 26.67 15 50 15 Z";
753
+ case "octopus-blob":
754
+ return "M 50 12.5 C 70 12.5 83.33 27.5 83.33 47.5 L 83.33 65.83 C 83.33 73.33 77.5 75 74.17 69.17 C 71.67 65 66.67 65 64.17 69.17 C 61.67 73.33 56.67 73.33 54.17 69.17 C 51.67 65 46.67 65 44.17 69.17 C 41.67 73.33 36.67 73.33 34.17 69.17 C 31.67 65 26.67 65 24.17 69.17 C 20.83 75 16.67 73.33 16.67 65.83 L 16.67 47.5 C 16.67 27.5 30 12.5 50 12.5 Z";
755
+ case "wave-blob":
756
+ return "M 50 13.33 C 63.33 13.33 75 20 76.67 31.67 C 77.5 40 70 43.33 76.67 50 C 82.5 56.67 75 73.33 56.67 76.67 C 50 78.33 43.33 78.33 36.67 75.83 C 21.67 70.83 17.5 58.33 23.33 51.67 C 28.33 45.83 21.67 41.67 23.33 33.33 C 25.83 20.83 36.67 13.33 50 13.33 Z";
757
+ default:
758
+ return "M 50 12 C 78 12 90 26 90 52 C 90 78 78 88 50 88 C 22 88 10 78 10 52 C 10 26 22 12 50 12 Z";
759
+ }
760
+ }
761
+ const Mt = "M -4 2 C 2 2 5 -2 1 -5 C -3 -8 -10 -6 -10 -1 C -10 5 -2 8 4 4 C 9 1 7 -6 0 -7";
762
+ function vt(o, t, e, i, n, c = "") {
763
+ return `<g transform="translate(${o.toFixed(2)}, ${t.toFixed(2)}) scale(${e.toFixed(3)})" ${c}>
764
+ <path d="${Mt}" stroke="${i}" stroke-width="${(n / e).toFixed(2)}" stroke-linecap="round" stroke-linejoin="round" fill="none" />
765
+ </g>`;
766
+ }
767
+ function _e(o, t, e, i, n = {}, c = 0) {
768
+ const a = c || (typeof performance < "u" ? performance.now() / 1e3 : Date.now() / 1e3), h = "#2C2C2A", $ = "#F0997B", b = 3.5, M = gt(o).split(/(?=M )/).map((r) => r.trim()).filter(Boolean).map((r) => `<path d="${r}" fill="${t}" />`).join(""), { flipX: v = !1, emphasis: Y = !1 } = n, A = Math.max(-13.2, Math.min(13.2, e.gazeX ?? 0)), B = Math.max(-8.4, Math.min(8.4, e.gazeY ?? 0)), X = (e.eyeGap ?? 32) / 2, G = (e.eyeY ?? 45) + B, Z = 50 - X + A, _ = 50 + X + A, J = 40, ae = 50 + (e.shiftX ?? 0), K = e.turnAngle ?? 0, ie = (r) => {
769
+ const l = r - ae, k = Math.max(-J, Math.min(J, l)), C = Math.asin(k / J), L = C + K, p = Math.cos(L), z = p > 0, P = ae + J * Math.sin(L), T = z ? Math.max(0, p / Math.cos(C)) : 0;
770
+ return { projX: P, scaleX: T, isVisible: z };
771
+ }, I = ie(Z), E = ie(_), s = (e.eyeScale ?? 1) * (Y ? 1.15 : 1), Se = Math.round(e.eyeType ?? 0);
772
+ let le = "", fe = "";
773
+ const ce = (r, l, k, C) => {
774
+ if (k <= 0.01) return "";
775
+ const L = s * k, p = `transform="translate(${r}, ${l}) scale(${k.toFixed(2)}, 1) translate(${-r}, ${-l})"`;
776
+ switch (Se) {
777
+ case 1:
778
+ return `<g ${p}><path d="M ${r - 5.83 * s} ${l + 1.67 * s} Q ${r} ${l - 5.83 * s} ${r + 5.83 * s} ${l + 1.67 * s}" stroke="${h}" stroke-width="${b}" stroke-linecap="round" fill="none" /></g>`;
779
+ case 2:
780
+ return C ? `<g ${p}><path d="M ${r + 3.33 * s} ${l - 5 * s} L ${r - 3.33 * s} ${l} L ${r + 3.33 * s} ${l + 5 * s}" stroke="${h}" stroke-width="${b}" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>` : `<g ${p}><path d="M ${r - 3.33 * s} ${l - 5 * s} L ${r + 3.33 * s} ${l} L ${r - 3.33 * s} ${l + 5 * s}" stroke="${h}" stroke-width="${b}" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>`;
781
+ case 3:
782
+ return C ? `<g ${p}><line x1="${r - 5 * s}" y1="${l + 3 * s}" x2="${r + 5 * s}" y2="${l - 3 * s}" stroke="${h}" stroke-width="3.2" stroke-linecap="round" /></g>` : `<g ${p}><line x1="${r - 5 * s}" y1="${l - 3 * s}" x2="${r + 5 * s}" y2="${l + 3 * s}" stroke="${h}" stroke-width="3.2" stroke-linecap="round" /></g>`;
783
+ case 4:
784
+ return C ? `<g ${p}><line x1="${r - 5 * s}" y1="${l - 3 * s}" x2="${r + 5 * s}" y2="${l + 3 * s}" stroke="${h}" stroke-width="3.2" stroke-linecap="round" /></g>` : `<g ${p}><line x1="${r - 5 * s}" y1="${l + 3 * s}" x2="${r + 5 * s}" y2="${l - 3 * s}" stroke="${h}" stroke-width="3.2" stroke-linecap="round" /></g>`;
785
+ case 5:
786
+ return `<g ${p}>
787
+ <ellipse cx="${r}" cy="${l}" rx="${5 * s}" ry="${5.83 * s}" fill="#ffffff" />
788
+ <circle cx="${r}" cy="${l + 0.83 * s}" r="${2.17 * s}" fill="${h}" />
789
+ </g>`;
790
+ case 6:
791
+ return `<g ${p} fill="#E3536C"><path d="M ${r} ${l + 5 * s} C ${r - 8 * s} ${l - 2 * s} ${r - 5 * s} ${l - 7 * s} ${r} ${l - 3 * s} C ${r + 5 * s} ${l - 7 * s} ${r + 8 * s} ${l - 2 * s} ${r} ${l + 5 * s} Z" /></g>`;
792
+ case 7:
793
+ return `<g ${p} stroke="${h}" stroke-width="3.2">
794
+ <line x1="${r - 4.5 * s}" y1="${l - 4.5 * s}" x2="${r + 4.5 * s}" y2="${l + 4.5 * s}" stroke-linecap="round" />
795
+ <line x1="${r - 4.5 * s}" y1="${l + 4.5 * s}" x2="${r + 4.5 * s}" y2="${l - 4.5 * s}" stroke-linecap="round" />
796
+ </g>`;
797
+ case 8:
798
+ return `<g ${p} stroke="${h}" stroke-width="2.8" stroke-linecap="round">
799
+ <line x1="${r - 5 * s}" y1="${l - 2}" x2="${r + 5 * s}" y2="${l - 2}" />
800
+ <line x1="${r - 5 * s}" y1="${l + 2}" x2="${r + 5 * s}" y2="${l + 2}" />
801
+ </g>`;
802
+ case 9:
803
+ return C ? "" : `<g transform="translate(0, 0)">
804
+ <path d="M ${I.projX - 12} ${l - 2} L ${E.projX + 12} ${l - 2}" stroke="${h}" stroke-width="2.8" />
805
+ <rect x="${I.projX - 9}" y="${l - 6}" width="16" height="12" rx="3" fill="${h}" />
806
+ <rect x="${E.projX - 7}" y="${l - 6}" width="16" height="12" rx="3" fill="${h}" />
807
+ </g>`;
808
+ case 10:
809
+ return C ? `<g ${p}><circle cx="${r}" cy="${l}" r="${3.2 * s}" fill="${h}" /></g>` : `<g ${p}><ellipse cx="${r}" cy="${l}" rx="${6 * s}" ry="${8 * s}" fill="${h}" /></g>`;
810
+ case 11:
811
+ return C ? `<g ${p}><circle cx="${r}" cy="${l}" r="${4.2 * s}" fill="${h}" /></g>` : `<g ${p}><line x1="${r - 5 * s}" y1="${l}" x2="${r + 5 * s}" y2="${l}" stroke="${h}" stroke-width="3.2" stroke-linecap="round" /></g>`;
812
+ case 12:
813
+ return `<g ${p}>
814
+ <ellipse cx="${r}" cy="${l}" rx="${3 * s}" ry="${6 * s}" fill="${h}" />
815
+ </g>`;
816
+ case 13:
817
+ return `<g ${p}><circle cx="${r}" cy="${l}" r="${6.5 * s}" fill="${h}" /></g>`;
818
+ case 14:
819
+ return `<g ${p}><path d="M ${r - 5.83 * s} ${l - 1.67 * s} Q ${r} ${l + 5.83 * s} ${r + 5.83 * s} ${l - 1.67 * s}" stroke="${h}" stroke-width="${b}" stroke-linecap="round" fill="none" /></g>`;
820
+ case 15:
821
+ return C ? `<g ${p}><path d="M ${r + 6.67 * s} ${l + 2.5 * s} Q ${r} ${l - 5 * s} ${r - 6.67 * s} ${l - 0.83 * s}" stroke="${h}" stroke-width="${b}" stroke-linecap="round" fill="none" /></g>` : `<g ${p}><path d="M ${r - 6.67 * s} ${l + 2.5 * s} Q ${r} ${l - 5 * s} ${r + 6.67 * s} ${l - 0.83 * s}" stroke="${h}" stroke-width="${b}" stroke-linecap="round" fill="none" /></g>`;
822
+ case 16:
823
+ return `<g ${p}><path d="M ${r} ${l - 4.17 * s} L ${r} ${l + 3.33 * s}" stroke="${h}" stroke-width="${b}" stroke-linecap="round" fill="none" /></g>`;
824
+ case 17:
825
+ return C ? `<g ${p}><path d="M ${r + 5.83 * s} ${l - 6.67 * s} L ${r - 5 * s} ${l + 0.83 * s}" stroke="${h}" stroke-width="${b}" stroke-linecap="round" fill="none" /></g>` : `<g ${p}><path d="M ${r - 5.83 * s} ${l - 6.67 * s} L ${r + 5 * s} ${l + 0.83 * s}" stroke="${h}" stroke-width="${b}" stroke-linecap="round" fill="none" /></g>`;
826
+ case 18: {
827
+ const T = 4.6 * s, x = Ne().map(([D, ee], de) => {
828
+ const H = (r + D * T).toFixed(2), te = (l + ee * T).toFixed(2);
829
+ return `${de === 0 ? "M" : "L"} ${H} ${te}`;
830
+ }).join(" ");
831
+ return `<g ${p}><path d="${x}" stroke="${h}" stroke-width="1.3" stroke-linecap="round" fill="none" /></g>`;
832
+ }
833
+ case 19:
834
+ return `<g ${p}>
835
+ <circle cx="${r}" cy="${l}" r="${4.5 * s}" fill="none" stroke="${h}" stroke-width="2.63" />
836
+ <path d="M ${r - 2.83 * s} ${l - 0.42 * s} Q ${r} ${l + 2.83 * s} ${r + 2.83 * s} ${l - 0.42 * s}" stroke="${h}" stroke-width="2.63" stroke-linecap="round" fill="none" />
837
+ </g>`;
838
+ case 20:
839
+ return `<g ${p}><circle cx="${r}" cy="${l}" r="${3.67 * s}" fill="none" stroke="${h}" stroke-width="2.8" /></g>`;
840
+ case 21: {
841
+ const T = 6 * s, x = T * 0.22, D = `M ${r} ${l - T} Q ${r + x} ${l - x} ${r + T} ${l} Q ${r + x} ${l + x} ${r} ${l + T} Q ${r - x} ${l + x} ${r - T} ${l} Q ${r - x} ${l - x} ${r} ${l - T} Z`;
842
+ return `<g ${p}><path d="${D}" fill="${h}" /></g>`;
843
+ }
844
+ case 22:
845
+ return `<g ${p}>
846
+ <ellipse cx="${r}" cy="${l}" rx="${5.5 * s}" ry="${3.3 * s}" fill="#ffffff" stroke="${h}" stroke-width="1.4" />
847
+ <circle cx="${r - 2.2 * s}" cy="${l}" r="${1.8 * s}" fill="${h}" />
848
+ </g>`;
849
+ case 23:
850
+ return C ? `<g ${p}><ellipse cx="${r}" cy="${l}" rx="${2.83 * s}" ry="${Math.max(0.5, 2.83 * s * Math.max(0.05, e.eyeOpen))}" fill="${h}" /></g>` : `<g ${p}><path d="M ${r - 5 * s} ${l} Q ${r} ${l + 4 * s} ${r + 5 * s} ${l}" stroke="${h}" stroke-width="${b}" stroke-linecap="round" fill="none" /></g>`;
851
+ case 24: {
852
+ const T = 4.2 * s, x = 5.8 * s;
853
+ return `<g ${p}>
854
+ <ellipse cx="${r}" cy="${l}" rx="${T}" ry="${x}" fill="${h}" />
855
+ <circle cx="${r - T * 0.35}" cy="${l - x * 0.4}" r="${1.3 * s}" fill="#ffffff" />
856
+ </g>`;
857
+ }
858
+ case 25:
859
+ return C ? `<g ${p}>
860
+ <path d="M ${r - 5 * s} ${l} Q ${r} ${l + 2 * s} ${r + 5 * s} ${l}" stroke="${h}" stroke-width="${b}" stroke-linecap="round" fill="none" />
861
+ <line x1="${r + 5 * s}" y1="${l - 0.5 * s}" x2="${r + 7 * s}" y2="${l - 2.5 * s}" stroke="${h}" stroke-width="2" stroke-linecap="round" />
862
+ </g>` : `<g ${p}>
863
+ <path d="M ${r - 5 * s} ${l} Q ${r} ${l + 2 * s} ${r + 5 * s} ${l}" stroke="${h}" stroke-width="${b}" stroke-linecap="round" fill="none" />
864
+ <line x1="${r - 5 * s}" y1="${l - 0.5 * s}" x2="${r - 7 * s}" y2="${l - 2.5 * s}" stroke="${h}" stroke-width="2" stroke-linecap="round" />
865
+ </g>`;
866
+ case 26:
867
+ return `<g ${p}>
868
+ <circle cx="${r}" cy="${l}" r="${5 * s}" fill="none" stroke="${h}" stroke-width="2.2" />
869
+ <circle cx="${r + 1.6 * s}" cy="${l + 1.6 * s}" r="${1.7 * s}" fill="${h}" />
870
+ </g>`;
871
+ case 27: {
872
+ const T = 4 * s, x = 8 * s;
873
+ return `<g ${p}><path d="M ${r - T} ${l + x} L ${r - T} ${l - x} L ${r + T} ${l - x} L ${r + T} ${l + x}" stroke="${h}" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>`;
874
+ }
875
+ case 28:
876
+ return `<g ${p}><ellipse cx="${r}" cy="${l}" rx="${4.5 * s}" ry="${3 * s}" fill="${h}" /></g>`;
877
+ case 29:
878
+ return `<g ${p}>
879
+ <path d="M ${r - 4 * s} ${l - 3 * s} Q ${r} ${l - 6 * s} ${r + 4 * s} ${l - 2.5 * s}" stroke="${h}" stroke-width="2" stroke-linecap="round" fill="none" />
880
+ <circle cx="${r}" cy="${l + 1.5 * s}" r="${1.6 * s}" fill="${h}" />
881
+ </g>`;
882
+ case 30:
883
+ return C ? `<g ${p}><path d="M ${r + 6 * s} ${l - 6 * s} L ${r + 2 * s} ${l - 3 * s} L ${r + 5 * s} ${l - 1 * s} L ${r - 3 * s} ${l + 2 * s}" stroke="${h}" stroke-width="2.3" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>` : `<g ${p}><path d="M ${r - 6 * s} ${l - 6 * s} L ${r - 2 * s} ${l - 3 * s} L ${r - 5 * s} ${l - 1 * s} L ${r + 3 * s} ${l + 2 * s}" stroke="${h}" stroke-width="2.3" stroke-linecap="round" stroke-linejoin="round" fill="none" /></g>`;
884
+ case 31:
885
+ return `<g ${p}>
886
+ <circle cx="${r}" cy="${l}" r="${4 * s}" fill="none" stroke="${h}" stroke-width="2" />
887
+ <circle cx="${r}" cy="${l}" r="${1.3 * s}" fill="${h}" />
888
+ </g>`;
889
+ case 0:
890
+ default:
891
+ const z = 2.83 * L, P = Math.max(0.5, z * Math.max(0.05, e.eyeOpen));
892
+ return `<ellipse cx="${r.toFixed(2)}" cy="${l.toFixed(2)}" rx="${z.toFixed(2)}" ry="${P.toFixed(2)}" fill="${h}" />`;
893
+ }
894
+ };
895
+ le = I.isVisible ? ce(I.projX, G, I.scaleX, !1) : "", fe = E.isVisible ? ce(E.projX, G, E.scaleX, !0) : "";
896
+ let ne = "";
897
+ const se = e.tears ?? 0;
898
+ if (se > 0.01) {
899
+ const r = Math.min(1, se), l = a * 0.36 % 1;
900
+ let k = 0, C = r, L = 1;
901
+ if (l < 0.25) {
902
+ const p = l / 0.25;
903
+ k = p * 1.2, L = 0.75 + p * 0.35, C = r * (0.3 + p * 0.7);
904
+ } else if (l < 0.82) {
905
+ const p = (l - 0.25) / 0.57;
906
+ k = 1.2 + p * 10.5, L = 1.1 - p * 0.2, C = r;
907
+ } else {
908
+ const p = (l - 0.82) / 0.18;
909
+ k = 11.7 + p * 2.5, L = 0.9 - p * 0.4, C = r * (1 - p);
910
+ }
911
+ if (e.cascadeTears)
912
+ ne = `
913
+ <g opacity="${C.toFixed(2)}">
914
+ <path d="M ${I.projX - 3} ${G + 4} L ${I.projX - 6} 88 L ${I.projX + 2} 88 Z" fill="#7FA6D9" opacity="0.85" />
915
+ <path d="M ${E.projX - 2} ${G + 4} L ${E.projX - 2} 88 L ${E.projX + 6} 88 Z" fill="#7FA6D9" opacity="0.85" />
916
+ </g>
917
+ `;
918
+ else {
919
+ const p = (G + 7).toFixed(2), z = (I.projX - 1.2).toFixed(2), P = (E.projX + 1.2).toFixed(2), T = parseFloat(z), x = parseFloat(P), D = parseFloat(p);
920
+ ne = `
921
+ <g opacity="${C.toFixed(2)}">
922
+ <g transform="translate(0, ${k.toFixed(2)}) scale(${L.toFixed(2)})">
923
+ <!-- Lágrima redondita ojo izquierdo -->
924
+ <path d="M ${z} ${(D - 2.5).toFixed(2)} C ${(T + 2.2).toFixed(2)} ${(D - 0.5).toFixed(2)} ${(T + 2.2).toFixed(2)} ${(D + 2.2).toFixed(2)} ${z} ${(D + 3.2).toFixed(2)} C ${(T - 2.2).toFixed(2)} ${(D + 2.2).toFixed(2)} ${(T - 2.2).toFixed(2)} ${(D - 0.5).toFixed(2)} ${z} ${(D - 2.5).toFixed(2)} Z" fill="#ffffff" />
925
+ <!-- Lágrima redondita ojo derecho -->
926
+ <path d="M ${P} ${(D - 2.5).toFixed(2)} C ${(x + 2.2).toFixed(2)} ${(D - 0.5).toFixed(2)} ${(x + 2.2).toFixed(2)} ${(D + 2.2).toFixed(2)} ${P} ${(D + 3.2).toFixed(2)} C ${(x - 2.2).toFixed(2)} ${(D + 2.2).toFixed(2)} ${(x - 2.2).toFixed(2)} ${(D - 0.5).toFixed(2)} ${P} ${(D - 2.5).toFixed(2)} Z" fill="#ffffff" />
927
+ </g>
928
+ </g>
929
+ `;
930
+ }
931
+ }
932
+ let R = "";
933
+ if (e.zzz) {
934
+ const r = a * 0.75, l = 3;
935
+ R += `<g stroke="${h}" fill="none" stroke-linecap="round" stroke-linejoin="round">`;
936
+ for (let k = 0; k < l; k++) {
937
+ const C = (r + k / l) % 1, L = 68 + C * 20 + Math.sin(C * Math.PI * 2) * 2, p = 30 - C * 26, z = 0.5 + Math.sin(C * Math.PI) * 0.65, P = Math.sin(C * Math.PI) * 0.95, T = (1.8 + z * 0.7).toFixed(2), x = z.toFixed(2);
938
+ P > 0.01 && (R += `
939
+ <g transform="translate(${L.toFixed(2)}, ${p.toFixed(2)}) scale(${x}) translate(-72, -31)" opacity="${P.toFixed(2)}">
940
+ <path d="M 68 28 L 76 28 L 68 34 L 76 34" stroke-width="${T}" />
941
+ </g>
942
+ `);
943
+ }
944
+ R += "</g>";
945
+ }
946
+ if (e.sweat) {
947
+ const r = [
948
+ { x: 80, delay: 0, scale: 1 },
949
+ { x: 20, delay: 0.4, scale: 0.85 },
950
+ { x: 71, delay: 0.7, scale: 0.7 }
951
+ ], l = Math.min(1, e.sweat);
952
+ R += '<g fill="#7FA6D9">';
953
+ for (const k of r) {
954
+ const C = (a * 1.2 + k.delay) % 1, L = 25 + C * 7, p = l * Math.sin(C * Math.PI);
955
+ p > 0.01 && (R += `
956
+ <g transform="translate(${k.x}, ${L.toFixed(2)}) scale(${k.scale}) translate(-80, -25)" opacity="${p.toFixed(2)}">
957
+ <path d="M 76 26 C 76 22 80 20 80 20 C 80 20 84 22 84 26 C 84 28.5 82.2 30 80 30 C 77.8 30 76 28.5 76 26 Z" />
958
+ </g>
959
+ `);
960
+ }
961
+ R += "</g>";
962
+ }
963
+ if (e.storm) {
964
+ const r = Math.min(1, e.storm), l = Math.sin(a * 1.4) * 1.2, k = Math.sin(a * 1.4 + 1.8) * 1.2, C = 0.85 + Math.sin(a * 1.4) * 0.15, L = 0.85 + Math.sin(a * 1.4 + 1.8) * 0.15;
965
+ R += `
966
+ <g opacity="${r.toFixed(2)}" fill="#8a8a86">
967
+ <path transform="translate(${l.toFixed(2)}, ${(Math.abs(l) * -0.4).toFixed(2)})" opacity="${C.toFixed(2)}" d="M 22 6 C 22 3 25 1.5 27 2.3 C 27.6 0.5 30 -0.3 31.7 1 C 33.3 -0.7 36.5 0.3 36.5 3 C 38.2 3 39.5 4.5 39 6.2 C 39 8 37.3 9 35.6 9 L 24 9 C 22.3 9 22 7.5 22 6 Z" />
968
+ <path transform="translate(${k.toFixed(2)}, ${(Math.abs(k) * -0.4).toFixed(2)})" opacity="${L.toFixed(2)}" d="M 62 8 C 62 5.3 64.8 3.9 66.6 4.6 C 67.2 3 69.4 2.3 71 3.5 C 72.5 1.9 75.4 2.8 75.4 5.3 C 77 5.3 78.2 6.7 77.7 8.2 C 77.7 9.8 76.1 10.7 74.6 10.7 L 63.8 10.7 C 62.3 10.7 62 9.4 62 8 Z" />
969
+ </g>
970
+ `;
971
+ }
972
+ if (e.scribble) {
973
+ const r = Math.min(1, e.scribble), l = Math.sin(a * 1.6) * 6, k = 1 + Math.sin(a * 2.3) * 0.06;
974
+ R += `
975
+ <g transform="translate(50, 3) rotate(${l.toFixed(2)}) translate(-50, -3)" opacity="${r.toFixed(2)}">
976
+ ${vt(50, 3, k, "#5B7FD6", 2.3)}
977
+ </g>
978
+ `;
979
+ }
980
+ if (e.puff) {
981
+ const r = a * 0.55 % 1, l = e.mouthY ?? 63, k = 68 + r * 12, C = l - r * 10, L = 0.4 + r * 0.9, p = Math.min(1, e.puff) * Math.sin(r * Math.PI) * 0.8;
982
+ p > 0.01 && (R += `
983
+ <g fill="#B9BDB6" opacity="${p.toFixed(2)}" transform="translate(${k.toFixed(2)}, ${C.toFixed(2)}) scale(${L.toFixed(2)})">
984
+ <circle cx="0" cy="0" r="3.4" />
985
+ <circle cx="3" cy="-1.2" r="2.1" />
986
+ <circle cx="-2.4" cy="-1" r="1.8" />
987
+ </g>
988
+ `);
989
+ }
990
+ let he = "";
991
+ if (e.browY !== 0 || e.browTilt !== 0) {
992
+ const r = 32 + e.browY + B * 0.5, l = e.browTilt, k = -e.browTilt;
993
+ he = `
994
+ <g transform="rotate(${l}, ${I.projX}, ${r})">
995
+ <line x1="${I.projX - 6}" y1="${r}" x2="${I.projX + 6}" y2="${r}" stroke="${h}" stroke-width="2.8" stroke-linecap="round" />
996
+ </g>
997
+ <g transform="rotate(${k}, ${E.projX}, ${r})">
998
+ <line x1="${E.projX - 6}" y1="${r}" x2="${E.projX + 6}" y2="${r}" stroke="${h}" stroke-width="2.8" stroke-linecap="round" />
999
+ </g>
1000
+ `;
1001
+ }
1002
+ const pe = Math.round(e.mouthType ?? 0), w = Math.max(0, 14 * e.mouthWidth), m = 50 + A * 0.6, u = (e.mouthY ?? 63) + B * 0.4;
1003
+ let S = "";
1004
+ switch (pe) {
1005
+ case 1:
1006
+ S = `<ellipse cx="${m}" cy="${u}" rx="${w}" ry="${w * 1.24}" fill="#B3554A" />`;
1007
+ break;
1008
+ case 2: {
1009
+ const r = w * 2 / 4;
1010
+ let l = `M ${m - w} ${u}`;
1011
+ for (let k = 1; k <= 4; k++) l += ` L ${m - w + r * k} ${u + (k % 2 ? 2.83 : 0)}`;
1012
+ S = `<path d="${l}" fill="none" stroke="${h}" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round" />`;
1013
+ break;
1014
+ }
1015
+ case 3:
1016
+ S = `<line x1="${m - w}" y1="${u}" x2="${m + w}" y2="${u}" stroke="${h}" stroke-width="${b}" stroke-linecap="round" />`;
1017
+ break;
1018
+ case 13:
1019
+ S = `<circle cx="${m}" cy="${u}" r="${w * 2}" fill="none" stroke="${h}" stroke-width="2.8" />`;
1020
+ break;
1021
+ case 14:
1022
+ S = "";
1023
+ break;
1024
+ case 4:
1025
+ S = `
1026
+ <rect x="${m - 10}" y="${u - 4}" width="20" height="8" rx="2" fill="#ffffff" stroke="${h}" stroke-width="2.5" />
1027
+ <line x1="${m - 10}" y1="${u}" x2="${m + 10}" y2="${u}" stroke="${h}" stroke-width="1.8" />
1028
+ <line x1="${m - 3}" y1="${u - 4}" x2="${m - 3}" y2="${u + 4}" stroke="${h}" stroke-width="1.5" />
1029
+ <line x1="${m + 3}" y1="${u - 4}" x2="${m + 3}" y2="${u + 4}" stroke="${h}" stroke-width="1.5" />
1030
+ `;
1031
+ break;
1032
+ case 5:
1033
+ S = `
1034
+ <path d="M ${m - 12} ${u - 2} Q ${m} ${u + 12} ${m + 12} ${u - 2} Z" fill="${h}" />
1035
+ <path d="M ${m - 10} ${u - 2} L ${m + 10} ${u - 2} L ${m + 8} ${u + 2} L ${m - 8} ${u + 2} Z" fill="#ffffff" />
1036
+ `;
1037
+ break;
1038
+ case 6:
1039
+ S = `<path d="M ${m - 13} ${u - 3} Q ${m} ${u + 14} ${m + 13} ${u - 3} Z" fill="#E87C8A" stroke="${h}" stroke-width="2.5" />`;
1040
+ break;
1041
+ case 7:
1042
+ S = `
1043
+ <g stroke="${h}" stroke-width="3.5" stroke-linecap="round">
1044
+ <line x1="${m - 5}" y1="${u - 5}" x2="${m + 5}" y2="${u + 5}" />
1045
+ <line x1="${m - 5}" y1="${u + 5}" x2="${m + 5}" y2="${u - 5}" />
1046
+ </g>
1047
+ `;
1048
+ break;
1049
+ case 8:
1050
+ S = `
1051
+ <g>
1052
+ <line x1="12" y1="${u - 2}" x2="${m - 14}" y2="${u - 2}" stroke="#ffffff" stroke-width="2" />
1053
+ <line x1="12" y1="${u + 4}" x2="${m - 14}" y2="${u + 4}" stroke="#ffffff" stroke-width="2" />
1054
+ <line x1="88" y1="${u - 2}" x2="${m + 14}" y2="${u - 2}" stroke="#ffffff" stroke-width="2" />
1055
+ <line x1="88" y1="${u + 4}" x2="${m + 14}" y2="${u + 4}" stroke="#ffffff" stroke-width="2" />
1056
+ <rect x="${m - 15}" y="${u - 7}" width="30" height="16" rx="3" fill="#ffffff" stroke="${h}" stroke-width="2.2" />
1057
+ </g>
1058
+ `;
1059
+ break;
1060
+ case 9:
1061
+ S = `<path d="M ${m - 6} ${u} Q ${m - 3} ${u - 3} ${m} ${u} Q ${m + 3} ${u - 3} ${m + 6} ${u}" fill="none" stroke="${h}" stroke-width="2.8" stroke-linecap="round" />`;
1062
+ break;
1063
+ case 10:
1064
+ S = `<circle cx="${m}" cy="${u}" r="2.5" fill="${h}" />`;
1065
+ break;
1066
+ case 11:
1067
+ S = `<line x1="${m - 6}" y1="${u + 3}" x2="${m + 6}" y2="${u - 3}" stroke="${h}" stroke-width="3" stroke-linecap="round" />`;
1068
+ break;
1069
+ case 12:
1070
+ S = `<path d="M ${m - w} ${u + 4} Q ${m} ${u - 6} ${m + w} ${u + 4}" fill="none" stroke="${h}" stroke-width="3.2" stroke-linecap="round" />`;
1071
+ break;
1072
+ case 15:
1073
+ S = `
1074
+ <path d="M ${m - w} ${u} Q ${m} ${u + 6} ${m + w} ${u}" fill="none" stroke="${h}" stroke-width="${b}" stroke-linecap="round" />
1075
+ <path d="M ${m - 3} ${u + 2} Q ${m} ${u + 10} ${m + 3} ${u + 2} Z" fill="#E3536C" />
1076
+ `;
1077
+ break;
1078
+ case 16:
1079
+ S = `<path d="M ${m - w} ${u} Q ${m + w * 0.3} ${u} ${m + w} ${u - 5}" fill="none" stroke="${h}" stroke-width="${b}" stroke-linecap="round" />`;
1080
+ break;
1081
+ case 17:
1082
+ S = `<path d="M ${m - 3.5} ${u - 2} L ${m + 3.5} ${u - 2} L ${m} ${u + 4} Z" fill="#E3536C" />`;
1083
+ break;
1084
+ case 18:
1085
+ S = `<path d="M ${m - 3} ${u - 4} Q ${m + 3} ${u - 4} ${m - 1} ${u} Q ${m + 3} ${u + 4} ${m - 3} ${u + 4}" fill="none" stroke="${h}" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" />`;
1086
+ break;
1087
+ case 19:
1088
+ S = `<path d="M ${m - 6} ${u - 4} L ${m + 6} ${u - 4} L ${m + 4} ${u + 5} L ${m - 4} ${u + 5} Z" fill="#B3554A" stroke="${h}" stroke-width="2" />`;
1089
+ break;
1090
+ case 20:
1091
+ S = `<ellipse cx="${m}" cy="${u}" rx="3" ry="1.4" fill="none" stroke="${h}" stroke-width="2.2" />`;
1092
+ break;
1093
+ case 21: {
1094
+ const r = w;
1095
+ let l = "";
1096
+ for (let k = 1; k < 4; k++) {
1097
+ const C = m - r + 2 * r / 4 * k;
1098
+ l += `<line x1="${C.toFixed(2)}" y1="${u - 4}" x2="${C.toFixed(2)}" y2="${u + 4}" stroke="${h}" stroke-width="1.3" />`;
1099
+ }
1100
+ S = `<rect x="${(m - r).toFixed(2)}" y="${u - 4}" width="${(r * 2).toFixed(2)}" height="8" rx="2" fill="#ffffff" stroke="${h}" stroke-width="2.2" />${l}`;
1101
+ break;
1102
+ }
1103
+ case 22:
1104
+ S = `
1105
+ <path d="M ${m - w} ${u} Q ${m} ${u + 5} ${m + w} ${u}" fill="none" stroke="${h}" stroke-width="${b}" stroke-linecap="round" />
1106
+ <path d="M ${m + w - 3} ${u + 2} Q ${m + w + 3} ${u + 6} ${m + w - 1} ${u + 9} Q ${m + w - 5} ${u + 6} ${m + w - 3} ${u + 2} Z" fill="#E3536C" />
1107
+ `;
1108
+ break;
1109
+ case 23:
1110
+ S = `
1111
+ <path d="M ${m - w * 1.1} ${u - 3} Q ${m} ${u + 10} ${m + w * 1.1} ${u - 3} Z" fill="#8a2f36" />
1112
+ <ellipse cx="${m}" cy="${u + 4}" rx="${w * 0.6}" ry="4" fill="#E3536C" />
1113
+ `;
1114
+ break;
1115
+ case 24:
1116
+ S = `
1117
+ <path d="M ${m - w} ${u} Q ${m} ${u + 7} ${m + w} ${u - 2}" fill="none" stroke="${h}" stroke-width="${b}" stroke-linecap="round" />
1118
+ <ellipse cx="${m + w * 0.3}" cy="${u + 3}" rx="2" ry="1.2" fill="#E3536C" opacity="0.7" />
1119
+ `;
1120
+ break;
1121
+ case 0:
1122
+ default:
1123
+ if (e.mouthCurve === 0)
1124
+ S = `<line x1="${m - w}" y1="${u}" x2="${m + w}" y2="${u}" stroke="${h}" stroke-width="${b}" stroke-linecap="round" />`;
1125
+ else {
1126
+ const r = u + e.mouthCurve * 14;
1127
+ S = `<path d="M ${m - w} ${u} Q ${m} ${r.toFixed(2)} ${m + w} ${u}" fill="none" stroke="${h}" stroke-width="${b}" stroke-linecap="round" />`;
1128
+ }
1129
+ break;
1130
+ }
1131
+ const ue = Math.max(0, Math.min(1, e.cheek));
1132
+ let j = "";
1133
+ e.blushStripes ? j = `
1134
+ <g stroke="#E3536C" stroke-width="2" opacity="0.75" stroke-linecap="round">
1135
+ <line x1="20" y1="52" x2="24" y2="58" />
1136
+ <line x1="24" y1="52" x2="28" y2="58" />
1137
+ <line x1="28" y1="52" x2="32" y2="58" />
1138
+ <line x1="68" y1="52" x2="72" y2="58" />
1139
+ <line x1="72" y1="52" x2="76" y2="58" />
1140
+ <line x1="76" y1="52" x2="80" y2="58" />
1141
+ </g>
1142
+ ` : ue > 0.01 && (j = `
1143
+ <ellipse cx="${27 + A * 0.4}" cy="${56 + B * 0.4}" rx="6" ry="4" fill="${$}" opacity="${ue.toFixed(2)}" />
1144
+ <ellipse cx="${73 + A * 0.4}" cy="${56 + B * 0.4}" rx="6" ry="4" fill="${$}" opacity="${ue.toFixed(2)}" />
1145
+ `);
1146
+ const re = [
1147
+ `translate(${(e.shiftX ?? 0).toFixed(2)}, ${e.bob.toFixed(2)})`,
1148
+ v ? "translate(100, 0) scale(-1, 1)" : "",
1149
+ Y ? "translate(50, 50) scale(1.1) translate(-50, -50)" : ""
1150
+ ].filter(Boolean).join(" ");
1151
+ return `
1152
+ <svg width="${i}" height="${i}" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" style="overflow: visible;">
1153
+ <defs>
1154
+ <style>
1155
+ @keyframes wissive-zzz-loop {
1156
+ 0% { transform: translate(0px, 4px) scale(0.55); opacity: 0; }
1157
+ 18% { transform: translate(3px, -2px) scale(0.85); opacity: 0.95; }
1158
+ 55% { transform: translate(8px, -11px) scale(1.1); opacity: 1; }
1159
+ 85% { transform: translate(14px, -19px) scale(0.85); opacity: 0.6; }
1160
+ 100% { transform: translate(18px, -25px) scale(0.5); opacity: 0; }
1161
+ }
1162
+ @keyframes wissive-tear-drip {
1163
+ 0% { transform: translateY(-2px) scaleY(0.7); opacity: 0.4; }
1164
+ 50% { transform: translateY(5px) scaleY(1.18); opacity: 0.95; }
1165
+ 85% { transform: translateY(12px) scaleY(0.8); opacity: 0.3; }
1166
+ 100% { transform: translateY(15px) scaleY(0.3); opacity: 0; }
1167
+ }
1168
+ @keyframes wissive-sweat-slide {
1169
+ 0% { transform: translateY(0px); opacity: 0.4; }
1170
+ 50% { transform: translateY(5px); opacity: 0.95; }
1171
+ 100% { transform: translateY(9px); opacity: 0.15; }
1172
+ }
1173
+ .wissive-zzz-1 { animation: wissive-zzz-loop 3s cubic-bezier(0.33, 0, 0.25, 1) infinite 0s; transform-box: fill-box; transform-origin: center; }
1174
+ .wissive-zzz-2 { animation: wissive-zzz-loop 3s cubic-bezier(0.33, 0, 0.25, 1) infinite -1s; transform-box: fill-box; transform-origin: center; }
1175
+ .wissive-zzz-3 { animation: wissive-zzz-loop 3s cubic-bezier(0.33, 0, 0.25, 1) infinite -2s; transform-box: fill-box; transform-origin: center; }
1176
+ .wissive-anim-tear { animation: wissive-tear-drip 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite; transform-box: fill-box; transform-origin: top center; }
1177
+ .wissive-anim-sweat { animation: wissive-sweat-slide 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: top center; }
1178
+ </style>
1179
+ </defs>
1180
+ <g transform="${re}">
1181
+ <!-- Silueta del cuerpo (una o varias subformas: cuerpo + orejas, brazos…) -->
1182
+ ${M}
1183
+ <!-- Mejillas o Rayas -->
1184
+ ${j}
1185
+ <!-- Accesorios (ZZZ, Gotas) -->
1186
+ ${R}
1187
+ <!-- Lágrimas -->
1188
+ ${ne}
1189
+ <!-- Ojos -->
1190
+ ${le}
1191
+ ${fe}
1192
+ <!-- Cejas -->
1193
+ ${he}
1194
+ <!-- Boca -->
1195
+ ${S}
1196
+ </g>
1197
+ </svg>
1198
+ `;
1199
+ }
1200
+ function ao(o, t, e, i, n = {}) {
1201
+ return _e(o, t, e, i, n);
1202
+ }
1203
+ function Qe() {
1204
+ return typeof window > "u" || typeof window.matchMedia != "function" ? !0 : window.matchMedia("(hover: hover)").matches;
1205
+ }
1206
+ function kt() {
1207
+ return typeof window > "u" ? !1 : typeof window.matchMedia == "function" && window.matchMedia("(hover: none)").matches || "ontouchstart" in window || typeof navigator < "u" && navigator.maxTouchPoints > 0;
1208
+ }
1209
+ const we = /* @__PURE__ */ new Set();
1210
+ let Te = !1;
1211
+ function qe(o) {
1212
+ const t = o.clientX, e = o.clientY, i = (typeof window < "u" ? window.innerWidth : 1e3) / 2 || 1, n = (typeof window < "u" ? window.innerHeight : 1e3) / 2 || 1;
1213
+ for (const c of we) {
1214
+ const a = c.element.getBoundingClientRect(), h = a.left + a.width / 2, $ = a.top + a.height / 2;
1215
+ if (c.onGazeMove) {
1216
+ const M = Math.max(-0.6, Math.min(0.6, (t - h) / i)), v = Math.max(-0.6, Math.min(0.6, (e - $) / n));
1217
+ c.onGazeMove(22 * M, 14 * v);
1218
+ }
1219
+ if (c.isActive())
1220
+ continue;
1221
+ const d = Math.hypot(t - h, e - $) <= c.nearRadius;
1222
+ d !== c.isNear && (c.isNear = d, c.onNearChange(d));
1223
+ }
1224
+ }
1225
+ function Ct(o) {
1226
+ we.add(o), !Te && typeof window < "u" && (window.addEventListener("mousemove", qe, { passive: !0 }), Te = !0);
1227
+ }
1228
+ function wt(o) {
1229
+ we.delete(o), we.size === 0 && Te && typeof window < "u" && (window.removeEventListener("mousemove", qe), Te = !1);
1230
+ }
1231
+ function Tt(o, t, e = 120) {
1232
+ if (typeof window > "u")
1233
+ return () => {
1234
+ };
1235
+ let i = !1, n = !1, c = !1, a = !1;
1236
+ const h = () => {
1237
+ i = !0, t.onHoverStart();
1238
+ }, $ = () => {
1239
+ i = !1, n = !1, t.onHoverEnd();
1240
+ }, b = (_) => {
1241
+ _.button === 0 && (n = !0, t.onClickStart());
1242
+ }, d = () => {
1243
+ n && (n = !1, t.onClickEnd());
1244
+ }, M = () => {
1245
+ n = !0, t.onClickStart();
1246
+ }, v = () => {
1247
+ n && (n = !1, t.onClickEnd());
1248
+ }, Y = () => {
1249
+ n && (n = !1, t.onClickEnd());
1250
+ }, A = () => {
1251
+ c = !0, t.onHoverStart();
1252
+ }, B = () => {
1253
+ c = !1, a && (a = !1, n = !1, t.onClickEnd()), t.onHoverEnd();
1254
+ }, X = (_) => {
1255
+ (_.key === "Enter" || _.key === " ") && (_.preventDefault(), a || (a = !0, n = !0, t.onClickStart()));
1256
+ }, G = (_) => {
1257
+ (_.key === "Enter" || _.key === " ") && (_.preventDefault(), a && (a = !1, n = !1, t.onClickEnd()));
1258
+ };
1259
+ o.addEventListener("mouseenter", h), o.addEventListener("mouseleave", $), o.addEventListener("mousedown", b), window.addEventListener("mouseup", d), o.addEventListener("focus", A), o.addEventListener("blur", B), o.addEventListener("keydown", X), o.addEventListener("keyup", G), o.addEventListener("touchstart", M, { passive: !0 }), window.addEventListener("touchend", v, { passive: !0 }), window.addEventListener("touchcancel", Y, { passive: !0 });
1260
+ const Z = {
1261
+ element: o,
1262
+ nearRadius: e,
1263
+ isNear: !1,
1264
+ isActive: () => i || n || c,
1265
+ onNearChange: t.onNearChange,
1266
+ onGazeMove: t.onGazeMove
1267
+ };
1268
+ return (Qe() || t.onGazeMove) && Ct(Z), () => {
1269
+ o.removeEventListener("mouseenter", h), o.removeEventListener("mouseleave", $), o.removeEventListener("mousedown", b), window.removeEventListener("mouseup", d), o.removeEventListener("focus", A), o.removeEventListener("blur", B), o.removeEventListener("keydown", X), o.removeEventListener("keyup", G), o.removeEventListener("touchstart", M), window.removeEventListener("touchend", v), window.removeEventListener("touchcancel", Y), wt(Z);
1270
+ };
1271
+ }
1272
+ let Ae;
1273
+ function ze() {
1274
+ return Ae || (Ae = import(
1275
+ /* @vite-ignore */
1276
+ "cuelume"
1277
+ ).catch(() => null)), Ae;
1278
+ }
1279
+ class St {
1280
+ constructor() {
1281
+ g(this, "enabled", !0);
1282
+ g(this, "volume", 0.6);
1283
+ ze().then((t) => {
1284
+ try {
1285
+ t == null || t.setVolume(this.volume);
1286
+ } catch {
1287
+ }
1288
+ });
1289
+ }
1290
+ setEnabled(t) {
1291
+ this.enabled = t;
1292
+ }
1293
+ isEnabled() {
1294
+ return this.enabled;
1295
+ }
1296
+ setVolumeLevel(t) {
1297
+ this.volume = Math.max(0, Math.min(1, t)), ze().then((e) => {
1298
+ try {
1299
+ e == null || e.setVolume(this.volume);
1300
+ } catch {
1301
+ }
1302
+ });
1303
+ }
1304
+ getVolumeLevel() {
1305
+ return this.volume;
1306
+ }
1307
+ playCue(t, e = {}) {
1308
+ this.enabled && ze().then((i) => {
1309
+ try {
1310
+ i == null || i.play(t, { volume: e.volume ?? this.volume });
1311
+ } catch {
1312
+ }
1313
+ });
1314
+ }
1315
+ playSound(t, e) {
1316
+ if (!this.enabled) return;
1317
+ let i = "tick";
1318
+ switch (t) {
1319
+ case "happy":
1320
+ i = e === "click" ? "sparkle" : "chime";
1321
+ break;
1322
+ case "flutter":
1323
+ i = e === "click" ? "pulse" : "bloom";
1324
+ break;
1325
+ case "pleasure":
1326
+ i = e === "click" ? "bloom" : "droplet";
1327
+ break;
1328
+ case "peaceful":
1329
+ i = e === "click" ? "arrival" : "whisper";
1330
+ break;
1331
+ case "normal":
1332
+ i = e === "click" ? "toggle" : "tick";
1333
+ break;
1334
+ case "tired":
1335
+ case "sleepy":
1336
+ i = e === "click" ? "loading" : "whisper";
1337
+ break;
1338
+ case "sad":
1339
+ case "disappointed":
1340
+ i = e === "click" ? "scan" : "droplet";
1341
+ break;
1342
+ case "anxiety":
1343
+ case "stress":
1344
+ i = e === "click" ? "pulse" : "tick";
1345
+ break;
1346
+ case "anger":
1347
+ i = e === "click" ? "press" : "release";
1348
+ break;
1349
+ case "surprised":
1350
+ i = e === "click" ? "success" : "chime";
1351
+ break;
1352
+ case "numbness":
1353
+ i = e === "click" ? "ready" : "page";
1354
+ break;
1355
+ default:
1356
+ i = e === "click" ? "sparkle" : "tick";
1357
+ break;
1358
+ }
1359
+ this.playCue(i);
1360
+ }
1361
+ }
1362
+ const U = new St();
1363
+ function xt(o) {
1364
+ U.setEnabled(o);
1365
+ }
1366
+ function Yt() {
1367
+ return U.isEnabled();
1368
+ }
1369
+ function Ft(o) {
1370
+ U.setVolumeLevel(o);
1371
+ }
1372
+ function Et() {
1373
+ return U.getVolumeLevel();
1374
+ }
1375
+ class At {
1376
+ constructor(t, e) {
1377
+ g(this, "particles", []);
1378
+ g(this, "canvas");
1379
+ g(this, "ctx");
1380
+ g(this, "animating", !1);
1381
+ g(this, "rafId", null);
1382
+ g(this, "size");
1383
+ g(this, "dpr");
1384
+ g(this, "tick", () => {
1385
+ const t = this.canvas.width, e = this.canvas.height;
1386
+ this.ctx.clearRect(0, 0, t, e);
1387
+ const i = 0.016;
1388
+ for (let n = this.particles.length - 1; n >= 0; n--) {
1389
+ const c = this.particles[n];
1390
+ if (c.life -= i, c.life <= 0) {
1391
+ this.particles.splice(n, 1);
1392
+ continue;
1393
+ }
1394
+ c.vx *= 0.95, c.vy *= 0.95, c.swayFreq && c.swayAmp && (c.x += Math.sin((c.maxLife - c.life) * c.swayFreq) * c.swayAmp), c.x += c.vx, c.y += c.vy, c.rotation += c.rotSpeed, this.drawParticle(c);
1395
+ }
1396
+ this.particles.length > 0 ? this.rafId = requestAnimationFrame(this.tick) : (this.animating = !1, this.ctx.clearRect(0, 0, t, e));
1397
+ });
1398
+ this.size = e, this.dpr = typeof window < "u" && window.devicePixelRatio || 1, this.canvas = document.createElement("canvas"), this.setupCanvas(), t.style.position = "relative", t.style.overflow = "visible", t.appendChild(this.canvas), this.ctx = this.canvas.getContext("2d");
1399
+ }
1400
+ setupCanvas() {
1401
+ const t = this.dpr, e = this.size * 2.5;
1402
+ this.canvas.width = e * t, this.canvas.height = e * t, this.canvas.style.cssText = `
1403
+ position: absolute;
1404
+ top: -${this.size * 0.75}px;
1405
+ left: -${this.size * 0.75}px;
1406
+ width: ${e}px;
1407
+ height: ${e}px;
1408
+ pointer-events: none;
1409
+ z-index: 10;
1410
+ `;
1411
+ }
1412
+ resize(t) {
1413
+ this.size = t, this.dpr = typeof window < "u" && window.devicePixelRatio || 1, this.setupCanvas();
1414
+ }
1415
+ burst(t, e = 8, i, n) {
1416
+ const c = this.size * 2.5, a = i ?? c / 2, h = n ?? c / 2;
1417
+ for (let $ = 0; $ < e; $++) {
1418
+ const b = Math.PI * 2 * $ / e + (Math.random() - 0.5) * 0.7, d = 2.5 + Math.random() * 3.5, M = this.createParticle(t, a, h, b, d);
1419
+ this.particles.push(M);
1420
+ }
1421
+ this.animating || (this.animating = !0, this.tick());
1422
+ }
1423
+ createParticle(t, e, i, n, c) {
1424
+ const a = 10 + Math.random() * 15, h = e + Math.cos(n) * a, $ = i + Math.sin(n) * a, b = 0.6 + Math.random() * 0.5, d = {
1425
+ x: h,
1426
+ y: $,
1427
+ vx: Math.cos(n) * c,
1428
+ vy: Math.sin(n) * c - 1.2,
1429
+ life: b,
1430
+ maxLife: b,
1431
+ size: (6 + Math.random() * 8) * (this.size / 120),
1432
+ rotation: Math.random() * Math.PI * 2,
1433
+ rotSpeed: (Math.random() - 0.5) * 0.2,
1434
+ shape: "circle",
1435
+ color: "#F2A9B8",
1436
+ opacity: 1
1437
+ }, M = Math.random() > 0.6, v = (Y) => Y[Math.floor(Math.random() * Y.length)];
1438
+ switch (t) {
1439
+ case "happy":
1440
+ d.shape = M ? "sparkle" : "heart", d.color = v(["#F2A9B8", "#E3536C", "#FF8FAB", "#FFD1DC", "#FFF0F5"]), d.vy -= 0.6;
1441
+ break;
1442
+ case "pleasure":
1443
+ d.shape = M ? "circle" : "petal", d.color = v(["#F28FC2", "#FFC2DE", "#FFE3F0", "#E5739F"]), d.vy += 0.9, d.vx *= 0.6, d.rotSpeed *= 2.5, d.swayFreq = 5 + Math.random() * 3, d.swayAmp = 0.9 + Math.random() * 0.5;
1444
+ break;
1445
+ case "flutter":
1446
+ d.shape = M ? "sparkle" : "star", d.color = v(["#F2CB4E", "#FFD700", "#FFA500", "#FFF4CC"]), d.vy -= 1, d.vx *= 1.5, d.rotSpeed *= 2;
1447
+ break;
1448
+ case "peaceful":
1449
+ d.shape = M ? "circle" : "ring", d.color = v(["#9AC9A0", "#B5E8B5", "#7FD17F", "#E8F5E9"]), d.vy -= 0.8, d.swayFreq = 8 + Math.random() * 4, d.swayAmp = 0.4 + Math.random() * 0.4;
1450
+ break;
1451
+ case "normal":
1452
+ d.shape = M ? "circle" : "dot", d.color = v(["#C9DCD3", "#A8C7BB", "#E4F0EA", "#8FB3A4"]), d.size *= 0.65, d.vx *= 0.5, d.vy *= 0.5;
1453
+ break;
1454
+ case "tired":
1455
+ d.shape = M ? "ring" : "zzz", d.color = v(["#D6DBCF", "#BFC7B8", "#EDF0E8", "#A9B3A0"]), d.vy -= 1.2, d.vx *= 0.25, d.swayFreq = 6 + Math.random() * 4, d.swayAmp = 0.5;
1456
+ break;
1457
+ case "sleepy":
1458
+ d.shape = M ? "zzz" : "bubble", d.color = v(["#AFCBE0", "#D3E8F5", "#ffffff", "#8FB6D1"]), d.size *= 1.35, d.vy -= 1.5, d.vx *= 0.2, d.swayFreq = 3 + Math.random() * 2, d.swayAmp = 0.7;
1459
+ break;
1460
+ case "sad":
1461
+ d.shape = M ? "circle" : "drop", d.color = v(["#7FA6D9", "#A0C4E8", "#6B9ACF", "#E1F5FE"]), d.vy += 1.8, d.vx *= 0.3;
1462
+ break;
1463
+ case "disappointed":
1464
+ d.shape = M ? "drop" : "shard", d.color = v(["#EBD98A", "#C9B86B", "#F5E9B8", "#A89550"]), d.vy += 1.2, d.vx *= 0.8, d.rotSpeed *= 4;
1465
+ break;
1466
+ case "anxiety":
1467
+ d.shape = M ? "circle" : "zigzag", d.color = v(["#A99BD9", "#C4B5F0", "#8B7BC4", "#D1C4E9"]), d.size *= 0.8, d.vx *= 1.4;
1468
+ break;
1469
+ case "stress":
1470
+ d.shape = M ? "zigzag" : "spiral", d.color = v(["#C97F76", "#E09A91", "#A85F57", "#F0BDB6"]), d.size *= 0.9, d.rotSpeed *= 6, d.swayFreq = 12 + Math.random() * 6, d.swayAmp = 0.6;
1471
+ break;
1472
+ case "anger":
1473
+ d.shape = M ? "diamond" : "ember", d.color = v(["#D9566A", "#FF4444", "#FF6B35", "#FFA033"]), d.vy -= 1.4, d.vx *= 0.7, d.size *= 0.9;
1474
+ break;
1475
+ case "surprised":
1476
+ d.shape = M ? "dot" : "burst", d.color = v(["#F0B98A", "#FFCFA3", "#FF9F1C", "#FFE8D1"]), d.size *= 1.15, d.vx *= 1.8, d.vy *= 1.8;
1477
+ break;
1478
+ case "numbness":
1479
+ d.shape = M ? "dot" : "glitch", d.color = v(["#D9C6E0", "#C0A8CC", "#EDE2F0", "#A98FB8"]), d.vx *= 0.25, d.vy *= 0.25, d.life *= 0.6, d.rotSpeed = 0;
1480
+ break;
1481
+ default:
1482
+ d.shape = M ? "sparkle" : "circle", d.color = v(["#F2A9B8", "#F2CB4E", "#9AC9A0"]);
1483
+ break;
1484
+ }
1485
+ return d;
1486
+ }
1487
+ drawParticle(t) {
1488
+ const e = this.ctx, i = this.dpr, n = 1 - t.life / t.maxLife;
1489
+ let c = 1;
1490
+ n < 0.18 ? c = n / 0.18 : n > 0.65 && (c = (1 - n) / 0.35), c = Math.max(0, Math.min(1.2, c));
1491
+ const a = t.size * c;
1492
+ if (a <= 0.1) return;
1493
+ const h = Math.max(0, Math.min(1, t.life / t.maxLife * 1.2));
1494
+ switch (e.save(), e.translate(t.x * i, t.y * i), e.rotate(t.rotation), e.globalAlpha = h, t.shape) {
1495
+ case "heart":
1496
+ e.fillStyle = t.color, e.beginPath(), e.moveTo(0, a * 0.35 * i), e.bezierCurveTo(
1497
+ -a * 0.7 * i,
1498
+ -a * 0.1 * i,
1499
+ -a * 0.8 * i,
1500
+ -a * 0.8 * i,
1501
+ 0,
1502
+ -a * 0.45 * i
1503
+ ), e.bezierCurveTo(
1504
+ a * 0.8 * i,
1505
+ -a * 0.8 * i,
1506
+ a * 0.7 * i,
1507
+ -a * 0.1 * i,
1508
+ 0,
1509
+ a * 0.35 * i
1510
+ ), e.closePath(), e.fill();
1511
+ break;
1512
+ case "star": {
1513
+ e.fillStyle = t.color, e.beginPath();
1514
+ const $ = 5, b = a * i, d = a * 0.45 * i;
1515
+ for (let M = 0; M < $ * 2; M++) {
1516
+ const v = M % 2 === 0 ? b : d, Y = M * Math.PI / $ - Math.PI / 2, A = Math.cos(Y) * v, B = Math.sin(Y) * v;
1517
+ M === 0 ? e.moveTo(A, B) : e.lineTo(A, B);
1518
+ }
1519
+ e.closePath(), e.fill();
1520
+ break;
1521
+ }
1522
+ case "sparkle": {
1523
+ e.fillStyle = t.color, e.beginPath();
1524
+ const $ = a * 1.1 * i;
1525
+ e.moveTo(0, -$), e.quadraticCurveTo(0, 0, $, 0), e.quadraticCurveTo(0, 0, 0, $), e.quadraticCurveTo(0, 0, -$, 0), e.quadraticCurveTo(0, 0, 0, -$), e.closePath(), e.fill();
1526
+ break;
1527
+ }
1528
+ case "drop":
1529
+ e.fillStyle = t.color, e.beginPath(), e.moveTo(0, -a * 0.8 * i), e.bezierCurveTo(
1530
+ a * 0.7 * i,
1531
+ -a * 0.2 * i,
1532
+ a * 0.6 * i,
1533
+ a * 0.7 * i,
1534
+ 0,
1535
+ a * 0.7 * i
1536
+ ), e.bezierCurveTo(
1537
+ -a * 0.6 * i,
1538
+ a * 0.7 * i,
1539
+ -a * 0.7 * i,
1540
+ -a * 0.2 * i,
1541
+ 0,
1542
+ -a * 0.8 * i
1543
+ ), e.closePath(), e.fill();
1544
+ break;
1545
+ case "diamond":
1546
+ e.fillStyle = t.color, e.beginPath(), e.moveTo(0, -a * i), e.lineTo(a * 0.65 * i, 0), e.lineTo(0, a * i), e.lineTo(-a * 0.65 * i, 0), e.closePath(), e.fill();
1547
+ break;
1548
+ case "zigzag":
1549
+ e.strokeStyle = t.color, e.lineWidth = Math.max(2, a * 0.25) * i, e.lineCap = "round", e.lineJoin = "round", e.beginPath(), e.moveTo(-a * 0.6 * i, -a * 0.5 * i), e.lineTo(-a * 0.1 * i, -a * 0.1 * i), e.lineTo(-a * 0.3 * i, a * 0.1 * i), e.lineTo(a * 0.6 * i, a * 0.5 * i), e.stroke();
1550
+ break;
1551
+ case "ring":
1552
+ e.strokeStyle = t.color, e.lineWidth = Math.max(1.5, a * 0.25) * i, e.beginPath(), e.arc(0, 0, a * 0.55 * i, 0, Math.PI * 2), e.stroke();
1553
+ break;
1554
+ case "zzz":
1555
+ e.strokeStyle = t.color, e.lineWidth = Math.max(2, a * 0.25) * i, e.lineCap = "round", e.lineJoin = "round", e.beginPath(), e.moveTo(-a * 0.4 * i, -a * 0.5 * i), e.lineTo(a * 0.4 * i, -a * 0.5 * i), e.lineTo(-a * 0.4 * i, a * 0.5 * i), e.lineTo(a * 0.4 * i, a * 0.5 * i), e.stroke();
1556
+ break;
1557
+ case "petal":
1558
+ e.fillStyle = t.color, e.beginPath(), e.moveTo(0, -a * 0.9 * i), e.quadraticCurveTo(a * 0.75 * i, -a * 0.1 * i, 0, a * 0.9 * i), e.quadraticCurveTo(-a * 0.75 * i, -a * 0.1 * i, 0, -a * 0.9 * i), e.closePath(), e.fill();
1559
+ break;
1560
+ case "spiral": {
1561
+ e.strokeStyle = t.color, e.lineWidth = Math.max(1.5, a * 0.2) * i, e.lineCap = "round", e.beginPath();
1562
+ const $ = a * 0.85 * i;
1563
+ Ne().forEach(([b, d], M) => {
1564
+ const v = b * $, Y = d * $;
1565
+ M === 0 ? e.moveTo(v, Y) : e.lineTo(v, Y);
1566
+ }), e.stroke();
1567
+ break;
1568
+ }
1569
+ case "bubble":
1570
+ e.strokeStyle = t.color, e.lineWidth = Math.max(1, a * 0.14) * i, e.beginPath(), e.arc(0, 0, a * 0.6 * i, 0, Math.PI * 2), e.stroke(), e.fillStyle = t.color, e.globalAlpha *= 0.7, e.beginPath(), e.arc(-a * 0.22 * i, -a * 0.24 * i, a * 0.13 * i, 0, Math.PI * 2), e.fill();
1571
+ break;
1572
+ case "ember": {
1573
+ e.fillStyle = t.color, e.beginPath(), e.moveTo(0, -a * 0.95 * i), e.bezierCurveTo(
1574
+ a * 0.5 * i,
1575
+ -a * 0.2 * i,
1576
+ a * 0.62 * i,
1577
+ a * 0.55 * i,
1578
+ 0,
1579
+ a * 0.75 * i
1580
+ ), e.bezierCurveTo(
1581
+ -a * 0.62 * i,
1582
+ a * 0.55 * i,
1583
+ -a * 0.5 * i,
1584
+ -a * 0.2 * i,
1585
+ 0,
1586
+ -a * 0.95 * i
1587
+ ), e.closePath(), e.fill();
1588
+ break;
1589
+ }
1590
+ case "shard":
1591
+ e.fillStyle = t.color, e.beginPath(), e.moveTo(0, -a * 0.9 * i), e.lineTo(a * 0.55 * i, -a * 0.15 * i), e.lineTo(a * 0.2 * i, a * 0.85 * i), e.lineTo(-a * 0.45 * i, a * 0.3 * i), e.closePath(), e.fill();
1592
+ break;
1593
+ case "burst": {
1594
+ e.strokeStyle = t.color, e.lineWidth = Math.max(1.5, a * 0.22) * i, e.lineCap = "round", e.beginPath();
1595
+ for (let $ = 0; $ < 4; $++) {
1596
+ const b = $ * Math.PI / 2, d = a * 0.3 * i, M = a * i;
1597
+ e.moveTo(Math.cos(b) * d, Math.sin(b) * d), e.lineTo(Math.cos(b) * M, Math.sin(b) * M);
1598
+ }
1599
+ e.stroke();
1600
+ break;
1601
+ }
1602
+ case "dot":
1603
+ e.fillStyle = t.color, e.beginPath(), e.arc(0, 0, a * 0.28 * i, 0, Math.PI * 2), e.fill();
1604
+ break;
1605
+ case "glitch":
1606
+ e.fillStyle = t.color, e.fillRect(-a * 0.6 * i, -a * 0.28 * i, a * 1.2 * i, a * 0.22 * i), e.globalAlpha *= 0.6, e.fillRect(-a * 0.25 * i, a * 0.06 * i, a * 0.9 * i, a * 0.16 * i);
1607
+ break;
1608
+ case "circle":
1609
+ default:
1610
+ e.fillStyle = t.color, e.beginPath(), e.arc(0, 0, a * 0.5 * i, 0, Math.PI * 2), e.fill();
1611
+ break;
1612
+ }
1613
+ e.restore();
1614
+ }
1615
+ destroy() {
1616
+ this.rafId !== null && cancelAnimationFrame(this.rafId), this.particles = [], this.canvas.remove();
1617
+ }
1618
+ }
1619
+ class zt {
1620
+ constructor(t, e, i) {
1621
+ // Position
1622
+ g(this, "posX", 0);
1623
+ g(this, "posY", 0);
1624
+ // Velocity
1625
+ g(this, "velX", 0);
1626
+ g(this, "velY", 0);
1627
+ // Drag tracking
1628
+ g(this, "dragging", !1);
1629
+ g(this, "startPointerX", 0);
1630
+ g(this, "startPointerY", 0);
1631
+ g(this, "lastPointerX", 0);
1632
+ g(this, "lastPointerY", 0);
1633
+ g(this, "lastPointerTime", 0);
1634
+ // Velocity samples for a smooth toss (ring buffer of last N moves)
1635
+ g(this, "velocitySamples", []);
1636
+ g(this, "MAX_SAMPLES", 6);
1637
+ // Spring constants for the return-to-origin bounce
1638
+ g(this, "springK", 0.08);
1639
+ // stiffness — lower = softer jelly
1640
+ g(this, "springD", 0.82);
1641
+ // damping — lower = bouncier
1642
+ g(this, "tossDecay", 0.96);
1643
+ // air friction on free flight
1644
+ // Stretch limits
1645
+ g(this, "maxStretch", 0.25);
1646
+ // Physics loop
1647
+ g(this, "animating", !1);
1648
+ g(this, "rafId", null);
1649
+ // Callbacks
1650
+ g(this, "onUpdate");
1651
+ g(this, "onDragStart");
1652
+ g(this, "onDragEnd");
1653
+ // Element ref
1654
+ g(this, "el");
1655
+ // ─── Pointer Abstraction ───────────────────────────────────────────
1656
+ g(this, "handlePointerDown", (t) => {
1657
+ t.preventDefault(), this.startDrag(t.clientX, t.clientY);
1658
+ });
1659
+ g(this, "handlePointerMove", (t) => {
1660
+ this.dragging && this.moveDrag(t.clientX, t.clientY);
1661
+ });
1662
+ g(this, "handlePointerUp", () => {
1663
+ this.dragging && this.endDrag();
1664
+ });
1665
+ g(this, "handleTouchDown", (t) => {
1666
+ t.preventDefault();
1667
+ const e = t.touches[0];
1668
+ this.startDrag(e.clientX, e.clientY);
1669
+ });
1670
+ g(this, "handleTouchMove", (t) => {
1671
+ if (!this.dragging) return;
1672
+ t.preventDefault();
1673
+ const e = t.touches[0];
1674
+ this.moveDrag(e.clientX, e.clientY);
1675
+ });
1676
+ g(this, "handleTouchUp", () => {
1677
+ this.dragging && this.endDrag();
1678
+ });
1679
+ g(this, "physicsTick", () => {
1680
+ if (this.dragging) {
1681
+ this.emitState(), this.rafId = requestAnimationFrame(this.physicsTick);
1682
+ return;
1683
+ }
1684
+ const t = -this.springK * this.posX, e = -this.springK * this.posY;
1685
+ this.velX = (this.velX + t) * this.springD, this.velY = (this.velY + e) * this.springD, this.velX *= this.tossDecay, this.velY *= this.tossDecay, this.posX += this.velX, this.posY += this.velY, this.emitState();
1686
+ const i = Math.hypot(this.posX, this.posY), n = Math.hypot(this.velX, this.velY);
1687
+ if (i < 0.3 && n < 0.1) {
1688
+ this.posX = 0, this.posY = 0, this.velX = 0, this.velY = 0, this.animating = !1, this.emitState();
1689
+ return;
1690
+ }
1691
+ this.rafId = requestAnimationFrame(this.physicsTick);
1692
+ });
1693
+ this.el = t, this.onUpdate = e, this.onDragStart = i == null ? void 0 : i.onDragStart, this.onDragEnd = i == null ? void 0 : i.onDragEnd, this.el.addEventListener("mousedown", this.handlePointerDown), window.addEventListener("mousemove", this.handlePointerMove), window.addEventListener("mouseup", this.handlePointerUp), this.el.addEventListener("touchstart", this.handleTouchDown, { passive: !1 }), window.addEventListener("touchmove", this.handleTouchMove, { passive: !1 }), window.addEventListener("touchend", this.handleTouchUp);
1694
+ }
1695
+ // ─── Drag Logic ────────────────────────────────────────────────────
1696
+ startDrag(t, e) {
1697
+ var i;
1698
+ this.dragging = !0, this.startPointerX = t - this.posX, this.startPointerY = e - this.posY, this.lastPointerX = t, this.lastPointerY = e, this.lastPointerTime = performance.now(), this.velocitySamples = [], this.velX = 0, this.velY = 0, this.el.style.cursor = "grabbing", (i = this.onDragStart) == null || i.call(this), this.startPhysicsLoop();
1699
+ }
1700
+ moveDrag(t, e) {
1701
+ const i = performance.now(), n = Math.max(1, i - this.lastPointerTime);
1702
+ this.velocitySamples.push({
1703
+ x: (t - this.lastPointerX) / n,
1704
+ y: (e - this.lastPointerY) / n
1705
+ }), this.velocitySamples.length > this.MAX_SAMPLES && this.velocitySamples.shift(), this.posX = t - this.startPointerX, this.posY = e - this.startPointerY, this.lastPointerX = t, this.lastPointerY = e, this.lastPointerTime = i;
1706
+ }
1707
+ endDrag() {
1708
+ var t;
1709
+ if (this.dragging = !1, this.el.style.cursor = "pointer", this.velocitySamples.length > 0) {
1710
+ let e = 0, i = 0;
1711
+ for (const h of this.velocitySamples)
1712
+ e += h.x, i += h.y;
1713
+ const n = this.velocitySamples.length;
1714
+ this.velX = e / n * 16, this.velY = i / n * 16;
1715
+ const c = 25, a = Math.hypot(this.velX, this.velY);
1716
+ a > c && (this.velX = this.velX / a * c, this.velY = this.velY / a * c);
1717
+ }
1718
+ (t = this.onDragEnd) == null || t.call(this), this.startPhysicsLoop();
1719
+ }
1720
+ // ─── Physics Simulation ────────────────────────────────────────────
1721
+ startPhysicsLoop() {
1722
+ this.animating || (this.animating = !0, this.rafId = requestAnimationFrame(this.physicsTick));
1723
+ }
1724
+ emitState() {
1725
+ let t = 1, e = 1, i = 0;
1726
+ if (this.dragging) {
1727
+ const n = this.posX, c = this.posY, a = Math.hypot(n, c), h = Math.min(this.maxStretch, a * 2e-3), $ = Math.atan2(c, n);
1728
+ t = 1 + h * Math.abs(Math.cos($)), e = 1 - h * 0.5 * Math.abs(Math.cos($)), Math.abs(Math.sin($)) > Math.abs(Math.cos($)) && (e = 1 + h * Math.abs(Math.sin($)), t = 1 - h * 0.5 * Math.abs(Math.sin($))), i = Math.atan2(c, n) * 0.06;
1729
+ } else {
1730
+ const n = Math.hypot(this.velX, this.velY), c = Math.min(this.maxStretch, n * 0.012), a = Math.atan2(this.velY, this.velX);
1731
+ t = 1 + c * Math.abs(Math.cos(a)), e = 1 - c * 0.6 * Math.abs(Math.cos(a)), Math.abs(Math.sin(a)) > Math.abs(Math.cos(a)) && (e = 1 + c * Math.abs(Math.sin(a)), t = 1 - c * 0.6 * Math.abs(Math.sin(a))), i = Math.atan2(this.velY, this.velX) * 0.04;
1732
+ }
1733
+ this.onUpdate({
1734
+ offsetX: this.posX,
1735
+ offsetY: this.posY,
1736
+ scaleX: t,
1737
+ scaleY: e,
1738
+ rotation: i,
1739
+ isDragging: this.dragging
1740
+ });
1741
+ }
1742
+ destroy() {
1743
+ this.rafId !== null && cancelAnimationFrame(this.rafId), this.el.removeEventListener("mousedown", this.handlePointerDown), window.removeEventListener("mousemove", this.handlePointerMove), window.removeEventListener("mouseup", this.handlePointerUp), this.el.removeEventListener("touchstart", this.handleTouchDown), window.removeEventListener("touchmove", this.handleTouchMove), window.removeEventListener("touchend", this.handleTouchUp);
1744
+ }
1745
+ }
1746
+ function Pt() {
1747
+ return typeof window > "u" || !window.matchMedia ? !1 : window.matchMedia("(prefers-reduced-motion: reduce)").matches;
1748
+ }
1749
+ function Xt(o) {
1750
+ if (typeof window > "u" || !window.matchMedia)
1751
+ return () => {
1752
+ };
1753
+ const t = window.matchMedia("(prefers-reduced-motion: reduce)"), e = (i) => o(i.matches);
1754
+ return t.addEventListener ? (t.addEventListener("change", e), () => t.removeEventListener("change", e)) : (t.addListener(e), () => t.removeListener(e));
1755
+ }
1756
+ function Lt(o) {
1757
+ let t = o.trim().replace("#", "");
1758
+ if (t.length === 3 && (t = t.split("").map((e) => e + e).join("")), t.length === 6) {
1759
+ const e = parseInt(t, 16);
1760
+ return [(e >> 16 & 255) / 255, (e >> 8 & 255) / 255, (e & 255) / 255];
1761
+ }
1762
+ return [0, 0, 0];
1763
+ }
1764
+ function Oe(o) {
1765
+ const [t, e, i] = Lt(o), n = ($) => $ <= 0.03928 ? $ / 12.92 : Math.pow(($ + 0.055) / 1.055, 2.4), c = n(t), a = n(e), h = n(i);
1766
+ return 0.2126 * c + 0.7152 * a + 0.0722 * h;
1767
+ }
1768
+ function Dt(o, t) {
1769
+ const e = Oe(o), i = Oe(t), n = Math.max(e, i), c = Math.min(e, i);
1770
+ return (n + 0.05) / (c + 0.05);
1771
+ }
1772
+ function no(o, t, e = 3) {
1773
+ const i = Dt(o, t);
1774
+ return {
1775
+ ratio: Number(i.toFixed(2)),
1776
+ passes: i >= e
1777
+ };
1778
+ }
1779
+ const ro = {
1780
+ // Emociones positivas & energía
1781
+ happy: { baseColor: "#F7C6CE", strokeColor: "#1c1917" },
1782
+ excited: { baseColor: "#FFD54F", strokeColor: "#1c1917" },
1783
+ celebrate: { baseColor: "#FF80AB", strokeColor: "#1c1917" },
1784
+ laughing: { baseColor: "#FFE082", strokeColor: "#1c1917" },
1785
+ playful: { baseColor: "#F48FB1", strokeColor: "#1c1917" },
1786
+ proud: { baseColor: "#CE93D8", strokeColor: "#1c1917" },
1787
+ // Reposo, sueño & descanso
1788
+ idle: { baseColor: "#F7C6CE", strokeColor: "#1c1917" },
1789
+ sleeping: { baseColor: "#9FA8DA", strokeColor: "#1A237E" },
1790
+ drowsy: { baseColor: "#C5CAE9", strokeColor: "#283593" },
1791
+ "powering-down": { baseColor: "#78909C", strokeColor: "#263238" },
1792
+ bored: { baseColor: "#B0BEC5", strokeColor: "#37474F" },
1793
+ // Fuego, ira & alerta
1794
+ angry: { baseColor: "#EF5350", strokeColor: "#B71C1C" },
1795
+ alerting: { baseColor: "#FF7043", strokeColor: "#BF360C" },
1796
+ notifying: { baseColor: "#FFA726", strokeColor: "#E65100" },
1797
+ suspicious: { baseColor: "#D4E157", strokeColor: "#33691E" },
1798
+ // Pensamiento, procesamiento & escaneo AI
1799
+ thinking: { baseColor: "#4DD0E1", strokeColor: "#006064" },
1800
+ searching: { baseColor: "#26C6DA", strokeColor: "#004D40" },
1801
+ loading: { baseColor: "#4FC3F7", strokeColor: "#01579B" },
1802
+ listening: { baseColor: "#81C784", strokeColor: "#1B5E20" },
1803
+ dictating: { baseColor: "#AED581", strokeColor: "#33691E" },
1804
+ writing: { baseColor: "#FFF176", strokeColor: "#F57F17" },
1805
+ orbit: { baseColor: "#80DEEA", strokeColor: "#00838F" },
1806
+ radar: { baseColor: "#4DB6AC", strokeColor: "#004D40" },
1807
+ progress: { baseColor: "#64B5F6", strokeColor: "#0D47A1" },
1808
+ // Tristeza, duda & empatía
1809
+ sad: { baseColor: "#90CAF9", strokeColor: "#1565C0" },
1810
+ scared: { baseColor: "#B39DDB", strokeColor: "#4527A0" },
1811
+ confused: { baseColor: "#FFE082", strokeColor: "#E65100" },
1812
+ curious: { baseColor: "#A5D6A7", strokeColor: "#1B5E20" },
1813
+ shy: { baseColor: "#F48FB1", strokeColor: "#880E4F" },
1814
+ waking: { baseColor: "#FFF59D", strokeColor: "#F57F17" },
1815
+ spawning: { baseColor: "#E1BEE7", strokeColor: "#4A148C" }
1816
+ };
1817
+ function Be(o) {
1818
+ let t = o.trim().replace("#", "");
1819
+ t.length === 3 && (t = t.split("").map((i) => i + i).join(""));
1820
+ const e = parseInt(t, 16);
1821
+ return isNaN(e) ? { r: 247, g: 198, b: 206 } : {
1822
+ r: e >> 16 & 255,
1823
+ g: e >> 8 & 255,
1824
+ b: e & 255
1825
+ };
1826
+ }
1827
+ function It(o, t, e) {
1828
+ const i = Be(o), n = Be(t), c = Math.max(0, Math.min(1, e)), a = Math.round(i.r + (n.r - i.r) * c), h = Math.round(i.g + (n.g - i.g) * c), $ = Math.round(i.b + (n.b - i.b) * c), b = (d) => d.toString(16).padStart(2, "0");
1829
+ return `#${b(a)}${b(h)}${b($)}`;
1830
+ }
1831
+ function lo(o, t) {
1832
+ return {
1833
+ baseColor: t,
1834
+ strokeColor: "#1c1917"
1835
+ };
1836
+ }
1837
+ function q(o, t, e) {
1838
+ const i = o / t % 1;
1839
+ return i < e ? Math.sin(i / e * Math.PI) : 0;
1840
+ }
1841
+ const je = {
1842
+ // Mochi — saltitos alegres, mejillas que florecen en el apogeo
1843
+ bouncy(o, t, e, i) {
1844
+ const n = Math.abs(Math.sin(t * e));
1845
+ o.bob += n * i - i * 0.5, o.cheek += n * 0.15, o.eyeScale += n * 0.04, o.turnAngle += Math.sin(t * e * 0.5) * 0.05;
1846
+ },
1847
+ // Zumi — aleteo rápido lateral, entrecierra los ojos por el zumbido
1848
+ flutter(o, t, e, i) {
1849
+ const n = Math.sin(t * e);
1850
+ o.shiftX += n * i, o.bob += Math.cos(t * e * 0.7) * i * 0.5, o.turnAngle += n * 0.06, o.eyeScale -= Math.abs(n) * 0.03;
1851
+ },
1852
+ // Suri — respiración profunda y lenta, inclinación que va por detrás
1853
+ serene(o, t, e, i) {
1854
+ const n = Math.sin(t * e);
1855
+ o.bob += n * i, o.eyeScale += n * 0.05, o.cheek += (n + 1) * 0.06, o.turnAngle += Math.sin(t * e * 0.4 - 0.6) * 0.045;
1856
+ },
1857
+ // Nima — deriva fantasmal en ocho (frecuencias 2:1)
1858
+ float(o, t, e, i) {
1859
+ o.bob += Math.sin(t * e) * i, o.shiftX += Math.sin(t * e * 0.5) * i * 1.1, o.turnAngle += Math.sin(t * e * 0.5 - 0.9) * 0.07;
1860
+ },
1861
+ // Cota — respiración mínima y mirada que divaga sin rumbo
1862
+ calm(o, t, e, i) {
1863
+ const n = Math.sin(t * e);
1864
+ o.bob += n * i, o.eyeScale += n * 0.025, o.gazeX += Math.sin(t * e * 0.23) * 2.5, o.turnAngle += Math.sin(t * e * 0.31) * 0.03;
1865
+ },
1866
+ // Dozy — cabecea hasta dormirse y despierta de golpe
1867
+ droop(o, t, e, i) {
1868
+ const n = t * e * 0.18 % 1, c = n < 0.82 ? n / 0.82 : 1 - (n - 0.82) / 0.18;
1869
+ o.bob += c * i * 2.2, o.eyeOpen = Math.max(0, o.eyeOpen - c * 0.45), o.browY += c * 2, o.turnAngle += c * 0.12;
1870
+ },
1871
+ // Lumo — respiración entrecortada del llanto, mirada baja
1872
+ sob(o, t, e, i) {
1873
+ const n = Math.sin(t * e) + Math.sin(t * e * 2.7) * 0.4;
1874
+ o.bob += n * i, o.browY += 1 + Math.sin(t * e) * 0.8, o.gazeY += 1.5, o.mouthCurve -= 0.05 + Math.abs(Math.sin(t * e)) * 0.05;
1875
+ },
1876
+ // Fidge — temblor nervioso y mirada que se dispara de un lado a otro
1877
+ jitter(o, t, e, i) {
1878
+ o.shiftX += (Math.random() - 0.5) * i, o.bob += (Math.random() - 0.5) * i, o.gazeX += Math.sin(t * e * 1.7) * 4 + (Math.random() - 0.5) * 2, o.turnAngle += (Math.random() - 0.5) * 0.03;
1879
+ },
1880
+ // Brix — rumor contenido que estalla en llamaradas puntuales
1881
+ fiery(o, t, e, i) {
1882
+ const n = Math.sin(t * e * 3.1) * 0.35, c = Math.pow(Math.max(0, Math.sin(t * e * 0.35)), 6);
1883
+ o.bob += n * i - c * i * 1.8, o.shiftX += n * i * 0.5, o.eyeScale += c * 0.18, o.browY -= c * 2.5, o.browTilt -= c * 0.25;
1884
+ },
1885
+ // Wilt — se desinfla y se vuelve a inflar, resignado
1886
+ wilt(o, t, e, i) {
1887
+ const n = (Math.sin(t * e * 0.6) + 1) / 2;
1888
+ o.bob += n * i * 1.8, o.mouthCurve -= n * 0.12, o.browY += n * 1.6, o.eyeScale -= n * 0.05;
1889
+ },
1890
+ // Knot — bamboleo circular con la cabeza rodando
1891
+ dizzy(o, t, e, i) {
1892
+ o.shiftX += Math.sin(t * e) * i, o.bob += Math.cos(t * e) * i * 0.7, o.turnAngle += Math.sin(t * e) * 0.14, o.gazeX += Math.cos(t * e) * 3;
1893
+ },
1894
+ // Snug — respiración profunda de sueño, párpados pesados
1895
+ snooze(o, t, e, i) {
1896
+ const n = Math.sin(t * e);
1897
+ o.bob += n * i * 1.6, o.eyeScale += n * 0.06, o.eyeOpen *= 0.35, o.cheek += (n + 1) * 0.05, o.turnAngle += Math.sin(t * e - 0.8) * 0.05;
1898
+ },
1899
+ // Pip — sobresaltos secos; entre uno y otro aguanta la respiración con tensión
1900
+ pop(o, t, e, i) {
1901
+ const n = q(t, 1 / (e * 0.1), 0.18), c = Math.sin(t * e * 1.6) * 0.18;
1902
+ o.bob += c * i - n * i * 2.2, o.eyeScale += c * 0.02 + n * 0.22, o.browY -= n * 3, o.mouthOpen += n * 0.25;
1903
+ },
1904
+ // Void — casi inmóvil, con micro-fallos tipo glitch
1905
+ drift(o, t, e, i) {
1906
+ o.bob += Math.sin(t * e) * i * 0.6;
1907
+ const n = q(t, 3.7, 0.04);
1908
+ o.shiftX += n * (Math.random() - 0.5) * 5, o.gazeX += n * (Math.random() - 0.5) * 6, o.eyeScale -= n * 0.08;
1909
+ }
1910
+ };
1911
+ function Gt(o, t, e, i, n, c = 1) {
1912
+ (je[o] || je.calm)(t, e, i, n * c);
1913
+ }
1914
+ const Wt = {
1915
+ // ── Ciclo de vida ──────────────────────────────────────────────────
1916
+ sleeping(o, t) {
1917
+ const e = Math.sin(t * 0.9);
1918
+ o.eyeOpen = 0.05, o.bob += e * 2.4, o.eyeScale += e * 0.04, o.bob += q(t, 9, 0.15) * 1.8;
1919
+ },
1920
+ waking(o, t) {
1921
+ const e = q(t, 4, 0.4);
1922
+ o.bob += Math.sin(t * 2.2) * 1.6 - e * 3, o.eyeOpen = Math.min(1, 0.35 + e * 0.65), o.eyeScale += e * 0.1, o.turnAngle += Math.sin(t * 1.1) * 0.06;
1923
+ },
1924
+ listening(o, t) {
1925
+ o.turnAngle += 0.1 + Math.sin(t * 1.4) * 0.03, o.bob += q(t, 2.6, 0.25) * 2.2, o.eyeScale += 0.06, o.gazeY -= 0.8;
1926
+ },
1927
+ thinking(o, t) {
1928
+ o.gazeX += -6 + Math.sin(t * 0.9) * 3, o.gazeY += -4 + Math.cos(t * 0.7) * 2, o.browY -= 1 + Math.sin(t * 1.3) * 0.8, o.turnAngle += Math.sin(t * 0.6) * 0.05;
1929
+ },
1930
+ searching(o, t) {
1931
+ o.gazeX += Math.sin(t * 5.5) * 11, o.gazeY += Math.sin(t * 2.3) * 2.5, o.turnAngle += Math.sin(t * 5.5) * 0.05, o.eyeScale += 0.05;
1932
+ },
1933
+ working(o, t) {
1934
+ o.bob += Math.sin(t * 3.4) * 1.4, o.turnAngle += Math.sin(t * 3.4 - 0.5) * 0.035, o.gazeY += 1.5, o.mouthWidth *= 0.9;
1935
+ },
1936
+ // ── Reacciones ─────────────────────────────────────────────────────
1937
+ excited(o, t) {
1938
+ o.bob += -Math.abs(Math.sin(t * 7)) * 5.5, o.eyeScale += 0.1 + Math.abs(Math.sin(t * 7)) * 0.06, o.cheek += 0.2, o.turnAngle += Math.sin(t * 3.5) * 0.07;
1939
+ },
1940
+ surprised(o, t) {
1941
+ o.bob += Math.sin(t * 9) * 0.9, o.eyeScale += 0.12, o.browY -= 1.5, o.shiftX += Math.sin(t * 13) * 0.4;
1942
+ },
1943
+ suspicious(o, t) {
1944
+ o.gazeX += -7 + Math.sin(t * 0.5) * 2.5, o.eyeScale -= 0.08, o.browTilt -= 0.12, o.bob += Math.sin(t * 0.8) * 0.5;
1945
+ },
1946
+ angry(o, t) {
1947
+ o.shiftX += (Math.random() - 0.5) * 3, o.bob += (Math.random() - 0.5) * 2;
1948
+ const e = q(t, 2.2, 0.3);
1949
+ o.browY -= e * 2, o.browTilt -= e * 0.2;
1950
+ },
1951
+ drowsy(o, t) {
1952
+ const e = (Math.sin(t * 0.8) + 1) / 2;
1953
+ o.bob += e * 3, o.eyeOpen = Math.max(0.08, 0.5 - e * 0.4), o.eyeOpen += q(t, 6.5, 0.08) * 0.5, o.browY += e * 2;
1954
+ },
1955
+ happy(o, t) {
1956
+ o.bob += -Math.abs(Math.sin(t * 3.2)) * 2.4, o.cheek += 0.15 + Math.abs(Math.sin(t * 3.2)) * 0.1, o.turnAngle += Math.sin(t * 1.6) * 0.05;
1957
+ },
1958
+ curious(o, t) {
1959
+ o.turnAngle += Math.sin(t * 1.2) * 0.13, o.gazeX += Math.sin(t * 2.1) * 6, o.eyeScale += 0.08, o.bob += Math.sin(t * 2.4) * 1;
1960
+ },
1961
+ confused(o, t) {
1962
+ o.turnAngle += Math.sin(t * 0.9) * 0.16, o.shiftX += Math.sin(t * 0.9) * 1.8, o.browTilt += 0.15 + Math.sin(t * 1.7) * 0.1, o.gazeX += Math.sin(t * 0.6) * 4;
1963
+ },
1964
+ bored(o, t) {
1965
+ o.shiftX += Math.sin(t * 0.5) * 2.2, o.gazeX += 6 + Math.sin(t * 0.3) * 3, o.eyeOpen = Math.min(o.eyeOpen, 0.5), o.bob += q(t, 7, 0.2) * 2;
1966
+ },
1967
+ proud(o, t) {
1968
+ o.bob += -2 + Math.sin(t * 1.1) * 0.8, o.turnAngle += Math.sin(t * 0.7) * 0.04, o.gazeY -= 2, o.cheek += 0.1;
1969
+ },
1970
+ shy(o, t) {
1971
+ o.bob += 1.5 + Math.sin(t * 1.3) * 0.7, o.gazeX += -4 + Math.sin(t * 0.9) * 1.5, o.gazeY += 4, o.cheek += 0.25, o.eyeScale -= 0.06;
1972
+ },
1973
+ sad(o, t) {
1974
+ o.bob += 2 + Math.sin(t * 0.9) * 1.4, o.gazeY += 3, o.browY += 1.5, o.turnAngle += Math.sin(t * 0.5) * 0.03;
1975
+ },
1976
+ laughing(o, t) {
1977
+ o.bob += -Math.abs(Math.sin(t * 9)) * 4, o.mouthOpen += 0.2 + Math.abs(Math.sin(t * 9)) * 0.3, o.cheek += 0.3, o.turnAngle += Math.sin(t * 4.5) * 0.05;
1978
+ },
1979
+ scared(o, t) {
1980
+ o.shiftX += Math.sin(t * 22) * 1.2, o.bob += 1.2 + Math.sin(t * 18) * 0.8, o.eyeScale += 0.14, o.browTilt += 0.2;
1981
+ },
1982
+ playful(o, t) {
1983
+ o.bob += (Math.sin(t * 4.3) + Math.sin(t * 6.7) * 0.5) * 1.8, o.turnAngle += Math.sin(t * 3.1) * 0.11, o.shiftX += Math.sin(t * 2.2) * 1.5, o.cheek += 0.18;
1984
+ },
1985
+ celebrate(o, t) {
1986
+ o.bob += -Math.abs(Math.sin(t * 5)) * 7, o.turnAngle += Math.sin(t * 2.5) * 0.18, o.cheek += 0.35, o.eyeScale += 0.1;
1987
+ },
1988
+ // ── Morfos de agente ───────────────────────────────────────────────
1989
+ orbit(o, t) {
1990
+ o.gazeX += Math.cos(t * 2.2) * 10, o.gazeY += Math.sin(t * 2.2) * 6, o.turnAngle += Math.cos(t * 2.2) * 0.06;
1991
+ },
1992
+ radar(o, t) {
1993
+ const e = Math.sin(t * 1.6);
1994
+ o.gazeX += Math.sign(e) * Math.pow(Math.abs(e), 0.45) * 11, o.turnAngle += e * 0.05, o.eyeScale += 0.04;
1995
+ },
1996
+ progress(o, t) {
1997
+ const e = Math.pow(Math.max(0, Math.sin(t * 3)), 3);
1998
+ o.bob += -e * 3, o.eyeScale += e * 0.09;
1999
+ },
2000
+ // ── Ciclo de producto ──────────────────────────────────────────────
2001
+ spawning(o, t) {
2002
+ const e = Math.exp(-(t * 1.5 % 6) * 0.7);
2003
+ o.bob += -Math.sin(t * 6) * 4 * e, o.eyeScale += e * 0.15;
2004
+ },
2005
+ humming(o, t) {
2006
+ o.bob += Math.sin(t * 2.6) * 1.6, o.mouthOpen += 0.1 + Math.abs(Math.sin(t * 2.6)) * 0.08, o.turnAngle += Math.sin(t * 1.3) * 0.05, o.cheek += 0.12;
2007
+ },
2008
+ loading(o, t) {
2009
+ o.eyeScale += Math.sin(t * 1.8) * 0.08, o.bob += Math.sin(t * 1.8) * 1.2, o.gazeY += Math.sin(t * 0.9) * 1.5;
2010
+ },
2011
+ dictating(o, t) {
2012
+ o.mouthOpen = 0.25 + Math.abs(Math.sin(t * 11)) * 0.4, o.bob += Math.sin(t * 2) * 0.6, o.browY -= 0.5;
2013
+ },
2014
+ writing(o, t) {
2015
+ o.gazeY += 4, o.gazeX += Math.sin(t * 4.5) * 5, o.bob += Math.abs(Math.sin(t * 4.5)) * 1.2;
2016
+ },
2017
+ sending(o, t) {
2018
+ const e = q(t, 1.6, 0.3);
2019
+ o.shiftX += e * 4, o.bob += -e * 2, o.turnAngle += e * 0.08;
2020
+ },
2021
+ receiving(o, t) {
2022
+ const e = q(t, 1.6, 0.3);
2023
+ o.shiftX += -e * 4, o.bob += e * 1.5, o.eyeScale += e * 0.12;
2024
+ },
2025
+ uploading(o, t) {
2026
+ const e = 1 - t * 0.7 % 1;
2027
+ o.bob += e * 4 - 2, o.gazeY -= 2, o.eyeScale += (1 - e) * 0.05;
2028
+ },
2029
+ notifying(o, t) {
2030
+ const e = q(t, 2.4, 0.12) + q(t - 0.22, 2.4, 0.12);
2031
+ o.bob += -e * 4, o.eyeScale += e * 0.12, o.turnAngle += e * 0.06;
2032
+ },
2033
+ alerting(o, t) {
2034
+ o.shiftX += Math.sin(t * 16) * 2.5, o.bob += Math.sin(t * 12) * 1.5, o.eyeScale += 0.16, o.browY -= 2;
2035
+ },
2036
+ dragging(o, t) {
2037
+ o.turnAngle += Math.sin(t * 2.4 - 1.2) * 0.14, o.shiftX += Math.sin(t * 2.4) * 2, o.bob += Math.cos(t * 2.4 - 1.2) * 1.5;
2038
+ },
2039
+ bouncing(o, t) {
2040
+ o.bob += -Math.abs(Math.sin(t * 5.5)) * 8;
2041
+ },
2042
+ "powering-down"(o, t) {
2043
+ const e = Math.min(1, t % 8 / 8);
2044
+ o.bob += e * 4, o.eyeOpen = Math.max(0.03, 0.4 - e * 0.37), o.eyeOpen += q(t, 2.7, 0.05) * 0.3, o.eyeScale -= e * 0.1;
2045
+ }
2046
+ };
2047
+ function Ot(o, t, e, i, n) {
2048
+ const c = Wt[o];
2049
+ return c ? (c(t, e, i, n), !0) : !1;
2050
+ }
2051
+ const Bt = 600;
2052
+ function jt(o) {
2053
+ let t = null, e = !1;
2054
+ const i = () => {
2055
+ t !== null && (clearTimeout(t), t = null), e = !1;
2056
+ };
2057
+ return { play: (c, a = {}) => {
2058
+ if (i(), c.length === 0) return;
2059
+ const h = a.mode ?? "once";
2060
+ e = !0;
2061
+ let $ = 0, b = 1;
2062
+ const d = () => {
2063
+ if (!e) return;
2064
+ const M = c[$];
2065
+ o.applyStep(o.resolveStep(M)), t = setTimeout(() => {
2066
+ var v;
2067
+ if (h === "ping-pong")
2068
+ c.length > 1 && (($ + b >= c.length || $ + b < 0) && (b = -b), $ += b);
2069
+ else if ($ += 1, $ >= c.length)
2070
+ if (h === "loop")
2071
+ $ = 0;
2072
+ else {
2073
+ i(), (v = a.onComplete) == null || v.call(a);
2074
+ return;
2075
+ }
2076
+ d();
2077
+ }, M.duration ?? Bt);
2078
+ };
2079
+ d();
2080
+ }, stop: i, isPlaying: () => e };
2081
+ }
2082
+ const Ve = [
2083
+ {
2084
+ label: "Interacción",
2085
+ states: ["idle", "near", "hover", "click"]
2086
+ },
2087
+ {
2088
+ // `idle` vive en el grupo de Interacción, no se repite aquí
2089
+ label: "Ciclo de vida",
2090
+ states: ["sleeping", "waking", "listening", "thinking", "searching", "working"]
2091
+ },
2092
+ {
2093
+ label: "Reacciones",
2094
+ states: [
2095
+ "excited",
2096
+ "surprised",
2097
+ "suspicious",
2098
+ "angry",
2099
+ "drowsy",
2100
+ "happy",
2101
+ "curious",
2102
+ "confused",
2103
+ "bored",
2104
+ "proud",
2105
+ "shy",
2106
+ "sad",
2107
+ "laughing",
2108
+ "scared",
2109
+ "playful",
2110
+ "celebrate"
2111
+ ]
2112
+ },
2113
+ {
2114
+ label: "Morfos de agente",
2115
+ states: ["orbit", "radar", "progress"]
2116
+ },
2117
+ {
2118
+ label: "Ciclo de producto",
2119
+ states: [
2120
+ "spawning",
2121
+ "humming",
2122
+ "loading",
2123
+ "dictating",
2124
+ "writing",
2125
+ "sending",
2126
+ "receiving",
2127
+ "uploading",
2128
+ "notifying",
2129
+ "alerting",
2130
+ "dragging",
2131
+ "bouncing",
2132
+ "powering-down"
2133
+ ]
2134
+ }
2135
+ ], Zt = Ve.flatMap((o) => o.states), Rt = ["idle", "near", "hover", "click"], Nt = Ve.find((o) => o.label === "Reacciones").states, _t = Zt.filter(
2136
+ (o) => !Rt.includes(o)
2137
+ );
2138
+ function Qt(o, t) {
2139
+ return o ?? t ?? Nt;
2140
+ }
2141
+ function qt(o, t) {
2142
+ if (o.length <= 1) return o[0];
2143
+ let e = o[Math.floor(Math.random() * o.length)];
2144
+ for (; e === t; )
2145
+ e = o[Math.floor(Math.random() * o.length)];
2146
+ return e;
2147
+ }
2148
+ class Vt {
2149
+ constructor(t = [], e = {}) {
2150
+ g(this, "instances", /* @__PURE__ */ new Map());
2151
+ g(this, "options");
2152
+ g(this, "connectedPairs", /* @__PURE__ */ new Map());
2153
+ g(this, "isRunning", !1);
2154
+ g(this, "update", () => {
2155
+ const t = Array.from(this.instances.values());
2156
+ if (t.length < 2) return;
2157
+ const e = /* @__PURE__ */ new Set();
2158
+ for (let i = 0; i < t.length; i++)
2159
+ for (let n = i + 1; n < t.length; n++) {
2160
+ const c = t[i], a = t[n], h = c.getPosition(), $ = a.getPosition(), b = $.x - h.x, d = $.y - h.y, M = Math.hypot(b, d);
2161
+ if (M <= this.options.proximityThreshold && M > 0) {
2162
+ const v = this.getPairKey(c.id, a.id);
2163
+ if (e.add(v), this.options.enableGazeSync) {
2164
+ const A = Math.max(-0.8, Math.min(0.8, b / 160)) * 22, B = Math.max(-0.8, Math.min(0.8, d / 160)) * 14;
2165
+ c.setGaze({ x: A, y: B }), a.setGaze({ x: -A, y: -B });
2166
+ }
2167
+ let Y = this.connectedPairs.get(v);
2168
+ Y ? Math.random() < 0.08 && this.options.enableSynergies && (c.triggerParticles(1), a.triggerParticles(1)) : (Y = {
2169
+ idA: c.id,
2170
+ idB: a.id,
2171
+ connectedSince: Date.now()
2172
+ }, this.connectedPairs.set(v, Y), this.triggerSynergy(c, a));
2173
+ }
2174
+ }
2175
+ for (const [i, n] of this.connectedPairs.entries())
2176
+ if (!e.has(i)) {
2177
+ const c = this.instances.get(n.idA), a = this.instances.get(n.idB);
2178
+ c && c.setGaze({ x: 0, y: 0 }), a && a.setGaze({ x: 0, y: 0 }), this.connectedPairs.delete(i);
2179
+ }
2180
+ });
2181
+ this.options = {
2182
+ proximityThreshold: e.proximityThreshold ?? 220,
2183
+ enableGazeSync: e.enableGazeSync ?? !0,
2184
+ enableSynergies: e.enableSynergies ?? !0
2185
+ }, t.forEach((i) => this.add(i)), this.start();
2186
+ }
2187
+ add(t) {
2188
+ !t || !t.id || this.instances.set(t.id, t);
2189
+ }
2190
+ remove(t) {
2191
+ !t || !t.id || this.instances.delete(t.id);
2192
+ }
2193
+ start() {
2194
+ this.isRunning || (this.isRunning = !0, O.add(this.update));
2195
+ }
2196
+ stop() {
2197
+ this.isRunning && (this.isRunning = !1, O.remove(this.update));
2198
+ }
2199
+ getPairKey(t, e) {
2200
+ return t < e ? `${t}:${e}` : `${e}:${t}`;
2201
+ }
2202
+ /**
2203
+ * Reacción de sinergia entre dos emojis según sus emociones
2204
+ */
2205
+ triggerSynergy(t, e) {
2206
+ if (!this.options.enableSynergies) return;
2207
+ const i = t.emotionCategory || "happy", n = e.emotionCategory || "happy";
2208
+ if (U.playSound(i, "hover"), t.triggerParticles(6), e.triggerParticles(6), i === "happy" && n === "happy")
2209
+ t.bounce(), e.bounce();
2210
+ else if (i === "happy" && n === "sad" || i === "sad" && n === "happy") {
2211
+ const c = i === "happy" ? t : e, a = i === "sad" ? t : e;
2212
+ c.setEmotion("hover"), a.setEmotion("near");
2213
+ } else (i === "intense" || n === "intense") && (t.spin(0.5), e.spin(0.5));
2214
+ }
2215
+ destroy() {
2216
+ this.stop(), this.instances.clear(), this.connectedPairs.clear();
2217
+ }
2218
+ }
2219
+ function Ht(o = [], t = {}) {
2220
+ return new Vt(o, t);
2221
+ }
2222
+ const He = "wissive:custom:";
2223
+ function Ut(o) {
2224
+ const t = {};
2225
+ for (const e in o)
2226
+ t[e] = o[e].map((i) => ({ ...i }));
2227
+ return t;
2228
+ }
2229
+ function Jt(o, t = {}) {
2230
+ var b, d, M;
2231
+ const e = t.eyesFrom ? oe[t.eyesFrom] : void 0, i = t.mouthFrom ? oe[t.mouthFrom] : void 0, n = t.motionFrom ? oe[t.motionFrom] : void 0, c = t.particlesFrom ? oe[t.particlesFrom] : void 0, a = t.soundFrom ? oe[t.soundFrom] : void 0, h = Ut(Ce.expressions);
2232
+ for (const v in h) {
2233
+ const Y = e && (((b = e.expressions[v]) == null ? void 0 : b[0]) ?? e.expressions.idle[0]), A = i && (((d = i.expressions[v]) == null ? void 0 : d[0]) ?? i.expressions.idle[0]);
2234
+ h[v] = h[v].map((B) => ({
2235
+ ...B,
2236
+ ...Y && { eyeType: Y.eyeType, eyeScale: Y.eyeScale },
2237
+ ...A && {
2238
+ mouthType: A.mouthType,
2239
+ mouthCurve: A.mouthCurve,
2240
+ mouthWidth: A.mouthWidth
2241
+ },
2242
+ // Los overrides van al final y ganan: son para los tipos nuevos que
2243
+ // ningún personaje del catálogo tiene todavía, así que no hay un
2244
+ // "from" del que copiarlos.
2245
+ ...t.eyeTypeOverride !== void 0 && { eyeType: t.eyeTypeOverride },
2246
+ ...t.mouthTypeOverride !== void 0 && { mouthType: t.mouthTypeOverride }
2247
+ }));
2248
+ }
2249
+ const $ = (M = t.stateBank) == null ? void 0 : M.filter((v) => _t.includes(v));
2250
+ return {
2251
+ name: o,
2252
+ emotion: "custom",
2253
+ baseColor: t.baseColor || Ce.baseColor,
2254
+ silhouette: t.silhouette || "circle",
2255
+ motion: n ? { ...n.motion } : { ...Ce.motion },
2256
+ expressions: h,
2257
+ particleEmotion: c == null ? void 0 : c.emotion,
2258
+ soundEmotion: a == null ? void 0 : a.emotion,
2259
+ ...$ && $.length > 0 && { autonomousStatePool: $ }
2260
+ };
2261
+ }
2262
+ function Kt(o, t) {
2263
+ localStorage.setItem(He + o, JSON.stringify(t));
2264
+ }
2265
+ function co(o) {
2266
+ const t = localStorage.getItem(He + o);
2267
+ return t ? JSON.parse(t) : null;
2268
+ }
2269
+ function ho(o, t = {}) {
2270
+ const e = Jt(o, t);
2271
+ return oe[o] = e, Kt(o, e), e;
2272
+ }
2273
+ const eo = {
2274
+ idle: 1,
2275
+ near: 0.7,
2276
+ hover: 0.5,
2277
+ click: 0.35
2278
+ }, to = {
2279
+ xs: 48,
2280
+ sm: 80,
2281
+ base: 120,
2282
+ lg: 160,
2283
+ xl: 200,
2284
+ "2xl": 240
2285
+ };
2286
+ function Ze(o = "base") {
2287
+ return typeof o == "number" ? o : to[o] ?? 120;
2288
+ }
2289
+ function oo(o, t) {
2290
+ const {
2291
+ target: e,
2292
+ size: i = "base",
2293
+ interactive: n = !0,
2294
+ draggable: c = !0,
2295
+ nearRadius: a = 120,
2296
+ sound: h = !0,
2297
+ flipX: $ = !1,
2298
+ emphasis: b = !1,
2299
+ gazeTracking: d = !1,
2300
+ ambientParticles: M = !0,
2301
+ autonomousStates: v = !0,
2302
+ autonomousStatePool: Y,
2303
+ reducedMotion: A = "auto",
2304
+ theme: B = "auto"
2305
+ } = t, X = We(o) || We("mochi"), G = X.motion;
2306
+ let Z = Ze(i), _ = A, J = B, ae = X.baseColor;
2307
+ const K = X.particleEmotion || X.emotion, ie = X.soundEmotion || X.emotion, I = () => typeof _ == "boolean" ? _ : Pt(), E = document.createElement("div");
2308
+ E.className = "wissive-wrapper", E.style.width = `${Z}px`, E.style.height = `${Z}px`, E.style.display = "inline-block", E.style.position = "relative";
2309
+ const s = document.createElement("div");
2310
+ s.className = "wissive-emoji", s.setAttribute("role", "img"), n && s.setAttribute("tabindex", "0");
2311
+ const Se = {
2312
+ idle: "Reposo",
2313
+ near: "Cerca",
2314
+ hover: "Hover",
2315
+ click: "Presionado"
2316
+ }, le = (y) => {
2317
+ s.setAttribute(
2318
+ "aria-label",
2319
+ `${X.name} (${X.emotion}) emoji - Estado: ${Se[y] || y}`
2320
+ );
2321
+ };
2322
+ le("idle"), s.style.width = `${Z}px`, s.style.height = `${Z}px`, s.style.display = "inline-block", s.style.userSelect = "none", s.style.cursor = n ? "pointer" : "default", s.style.willChange = "transform", s.style.transformOrigin = "center center", E.appendChild(s), e.appendChild(E);
2323
+ const fe = Xt(() => {
2324
+ ee();
2325
+ });
2326
+ let ce = $, ne = b, se = d, R = h, he = c, pe = M, w = v, m = Qt(
2327
+ Y,
2328
+ X.autonomousStatePool
2329
+ );
2330
+ const u = new $t(), S = X.expressions.idle, ue = u.pickVariant(S, "idle"), j = ft(ue, {
2331
+ stiffness: G.stiffness,
2332
+ damping: G.damping
2333
+ });
2334
+ let re = !1, r = !1, l = !1, k = Math.random() * 100, C = !1, L = null, p = null;
2335
+ const z = new At(E, Z);
2336
+ let P = {
2337
+ offsetX: 0,
2338
+ offsetY: 0,
2339
+ scaleX: 1,
2340
+ scaleY: 1,
2341
+ rotation: 0
2342
+ }, T = null;
2343
+ const x = () => {
2344
+ T || (T = new zt(
2345
+ s,
2346
+ (y) => {
2347
+ P = y, D();
2348
+ },
2349
+ {
2350
+ onDragStart: () => {
2351
+ R && U.playSound(ie, "click");
2352
+ },
2353
+ onDragEnd: () => {
2354
+ z.burst(K, 10), R && U.playSound(ie, "bounce");
2355
+ }
2356
+ }
2357
+ ));
2358
+ };
2359
+ he && n && x();
2360
+ const D = () => {
2361
+ const y = I(), F = y ? 0 : G.idleSpeed * 0.35, W = y ? 0 : 0.04, V = 1 + W * Math.cos(k * F), Q = 1 - W * Math.sin(k * F), ye = P.offsetX !== 0 || P.offsetY !== 0 || P.scaleX !== 1 || P.scaleY !== 1;
2362
+ let Ye, Fe, Ee;
2363
+ ye ? (Ye = V * P.scaleX, Fe = Q * P.scaleY, Ee = P.rotation) : (Ye = V, Fe = Q, Ee = 0);
2364
+ const Je = P.offsetX, Ke = P.offsetY;
2365
+ s.style.transform = `translate(${Je.toFixed(1)}px, ${Ke.toFixed(1)}px) rotate(${(Ee * 180 / Math.PI).toFixed(2)}deg) scale(${Ye.toFixed(4)}, ${Fe.toFixed(4)})`;
2366
+ }, ee = () => {
2367
+ const y = j.getValues(), F = u.getState();
2368
+ let W = X.baseColor;
2369
+ if (typeof J == "object" && J.baseColor && (W = J.baseColor), ae = It(ae, W, 0.15), C && (y.eyeOpen = 0.05), !I() && !Ot(
2370
+ F,
2371
+ y,
2372
+ k,
2373
+ G.idleSpeed,
2374
+ G.idleAmplitude
2375
+ )) {
2376
+ const Q = eo[F] ?? 1;
2377
+ Gt(
2378
+ G.motionType,
2379
+ y,
2380
+ k,
2381
+ G.idleSpeed,
2382
+ G.idleAmplitude,
2383
+ Q
2384
+ );
2385
+ }
2386
+ D(), s.innerHTML = _e(
2387
+ X.silhouette,
2388
+ ae,
2389
+ y,
2390
+ Z,
2391
+ { flipX: ce, emphasis: ne },
2392
+ k
2393
+ );
2394
+ }, de = (y = u.getState()) => {
2395
+ u.setState(y);
2396
+ const F = u.resolvePool(X.expressions, y);
2397
+ if (!(!F || F.length === 0)) {
2398
+ if (F.length === 1) {
2399
+ const W = u.pickVariant(F, y);
2400
+ j.setTargets(W), O.add(N);
2401
+ return;
2402
+ }
2403
+ C = !0, O.add(N), setTimeout(() => {
2404
+ const W = u.pickVariant(F, y);
2405
+ j.setTargets(W), O.add(N), setTimeout(() => {
2406
+ C = !1, O.add(N);
2407
+ }, 120);
2408
+ }, 100);
2409
+ }
2410
+ }, H = (y) => {
2411
+ le(y), de(y);
2412
+ }, te = jt({
2413
+ resolveStep(y) {
2414
+ return { ...y.state ? u.pickVariant(
2415
+ u.resolvePool(X.expressions, y.state),
2416
+ y.state
2417
+ ) : {}, ...y.params };
2418
+ },
2419
+ applyStep(y) {
2420
+ j.setTargets(y), O.add(N);
2421
+ }
2422
+ }), N = (y) => {
2423
+ k += y;
2424
+ const F = j.update(y);
2425
+ ee(), !F && u.getState() !== "idle" && O.remove(N);
2426
+ };
2427
+ O.add(N);
2428
+ const Pe = () => {
2429
+ const W = 3e3 + Math.random() * 4e3;
2430
+ p = window.setTimeout(() => {
2431
+ u.getState() === "idle" && !C && (C = !0, O.add(N), L = window.setTimeout(() => {
2432
+ C = !1, O.add(N);
2433
+ }, 180)), Pe();
2434
+ }, W);
2435
+ };
2436
+ Pe();
2437
+ let $e = null;
2438
+ const Xe = () => {
2439
+ const y = G.idleIntervalMin, F = G.idleIntervalMax, W = y + Math.random() * (F - y);
2440
+ $e = window.setTimeout(() => {
2441
+ u.getState() === "idle" && !te.isPlaying() && de("idle"), Xe();
2442
+ }, W);
2443
+ };
2444
+ Xe();
2445
+ let be = null, ge = null;
2446
+ const Le = () => {
2447
+ const W = 3500 + Math.random() * 4500;
2448
+ be = window.setTimeout(() => {
2449
+ if (u.getState() === "idle" && !se && !te.isPlaying()) {
2450
+ const V = [
2451
+ { x: -9, y: 0 },
2452
+ { x: 9, y: 0 },
2453
+ { x: -7, y: -4 },
2454
+ { x: 7, y: -4 },
2455
+ { x: 0, y: -5 },
2456
+ { x: 0, y: 4 }
2457
+ ], Q = V[Math.floor(Math.random() * V.length)];
2458
+ j.setTargets({ gazeX: Q.x, gazeY: Q.y }), O.add(N);
2459
+ const ye = 1200 + Math.random() * 1500;
2460
+ ge = window.setTimeout(() => {
2461
+ se || (j.setTargets({ gazeX: 0, gazeY: 0 }), O.add(N));
2462
+ }, ye);
2463
+ }
2464
+ Le();
2465
+ }, W);
2466
+ };
2467
+ Le();
2468
+ let Me = null;
2469
+ const De = () => {
2470
+ const W = 3500 + Math.random() * 5e3;
2471
+ Me = window.setTimeout(() => {
2472
+ if (pe && !I()) {
2473
+ const V = u.getState();
2474
+ if (V === "idle" || V === "near" || V === "hover") {
2475
+ const Q = Math.floor(2 + Math.random() * 3);
2476
+ z.burst(K, Q);
2477
+ }
2478
+ }
2479
+ De();
2480
+ }, W);
2481
+ };
2482
+ De();
2483
+ let ve = null, ke = null, Ie = null;
2484
+ const Ge = () => {
2485
+ const W = 5e3 + Math.random() * 6e3;
2486
+ ve = window.setTimeout(() => {
2487
+ if (w && m.length > 0 && !I() && !te.isPlaying() && u.getState() === "idle" && !re && !r && !l) {
2488
+ const Q = qt(m, Ie);
2489
+ Ie = Q, H(Q);
2490
+ const ye = 1800 + Math.random() * 2200;
2491
+ ke = window.setTimeout(() => {
2492
+ u.getState() === Q && !re && !r && !l && H("idle");
2493
+ }, ye);
2494
+ }
2495
+ Ge();
2496
+ }, W);
2497
+ };
2498
+ Ge();
2499
+ const Ue = () => {
2500
+ $e !== null && (clearTimeout($e), $e = null), p !== null && (clearTimeout(p), p = null), L !== null && (clearTimeout(L), L = null), be !== null && (clearTimeout(be), be = null), ge !== null && (clearTimeout(ge), ge = null), Me !== null && (clearTimeout(Me), Me = null), ve !== null && (clearTimeout(ve), ve = null), ke !== null && (clearTimeout(ke), ke = null);
2501
+ };
2502
+ let xe = null;
2503
+ const me = () => l ? "click" : r ? "hover" : re ? "near" : "idle";
2504
+ return n && (xe = Tt(
2505
+ s,
2506
+ {
2507
+ onHoverStart: () => {
2508
+ r = !0, R && U.playSound(ie, "hover"), H(me());
2509
+ },
2510
+ onHoverEnd: () => {
2511
+ r = !1, H(me());
2512
+ },
2513
+ onClickStart: () => {
2514
+ l = !0, R && U.playSound(ie, "click"), I() || z.burst(K, 8), H(me());
2515
+ },
2516
+ onClickEnd: () => {
2517
+ l = !1, H(me());
2518
+ },
2519
+ onNearChange: (y) => {
2520
+ re = y, H(me());
2521
+ },
2522
+ onGazeMove: (y, F) => {
2523
+ se && (j.setTargets({ gazeX: y, gazeY: F }), O.add(N));
2524
+ }
2525
+ },
2526
+ a
2527
+ )), {
2528
+ id: "wissive-" + Math.random().toString(36).substring(2, 9),
2529
+ name: X.name,
2530
+ emotionCategory: X.emotion,
2531
+ getElement() {
2532
+ return s;
2533
+ },
2534
+ getPosition() {
2535
+ const y = s.getBoundingClientRect();
2536
+ return {
2537
+ x: y.left + y.width / 2,
2538
+ y: y.top + y.height / 2
2539
+ };
2540
+ },
2541
+ getCurrentState() {
2542
+ return u.getState();
2543
+ },
2544
+ setEmotion(y) {
2545
+ I() || (y === "click" ? z.burst(K, 8) : y === "hover" && z.burst(K, 4)), H(y);
2546
+ },
2547
+ spin(y = 1) {
2548
+ const F = j.getValues().turnAngle || 0;
2549
+ j.setTargets({ turnAngle: F + Math.PI * 2 * y }), O.add(N);
2550
+ },
2551
+ bounce() {
2552
+ R && U.playSound(ie, "bounce"), I() || z.burst(K, 5);
2553
+ const y = j.getValues().bob || 0;
2554
+ j.setTargets({ bob: y - 14 }), O.add(N);
2555
+ },
2556
+ setGaze(y) {
2557
+ j.setTargets({ gazeX: y.x, gazeY: y.y }), O.add(N);
2558
+ },
2559
+ setGazeTracking(y) {
2560
+ se = y, y || (j.setTargets({ gazeX: 0, gazeY: 0 }), O.add(N));
2561
+ },
2562
+ setSound(y) {
2563
+ R = y;
2564
+ },
2565
+ setDraggable(y) {
2566
+ he = y, y && !T && n ? x() : !y && T && (T.destroy(), T = null, P = { offsetX: 0, offsetY: 0, scaleX: 1, scaleY: 1, rotation: 0, isDragging: !1 }, D());
2567
+ },
2568
+ setFlipX(y) {
2569
+ ce = y, ee();
2570
+ },
2571
+ setEmphasis(y) {
2572
+ ne = y, ee();
2573
+ },
2574
+ setAmbientParticles(y) {
2575
+ pe = y;
2576
+ },
2577
+ setAutonomousStates(y) {
2578
+ w = y;
2579
+ },
2580
+ setAutonomousStatePool(y) {
2581
+ m = y;
2582
+ },
2583
+ setReducedMotion(y) {
2584
+ _ = y, ee();
2585
+ },
2586
+ setTheme(y) {
2587
+ J = y, ee();
2588
+ },
2589
+ setSize(y) {
2590
+ Z = Ze(y), E.style.width = `${Z}px`, E.style.height = `${Z}px`, s.style.width = `${Z}px`, s.style.height = `${Z}px`, z.resize(Z), ee();
2591
+ },
2592
+ triggerParticles(y = 8) {
2593
+ I() || z.burst(K, y);
2594
+ },
2595
+ playSequence(y, F) {
2596
+ te.play(y, F);
2597
+ },
2598
+ stopSequence() {
2599
+ te.stop(), de(u.getState());
2600
+ },
2601
+ isSequencePlaying() {
2602
+ return te.isPlaying();
2603
+ },
2604
+ destroy() {
2605
+ te.stop(), Ue(), fe(), O.remove(N), z.destroy(), T && T.destroy(), xe && xe(), E.remove();
2606
+ }
2607
+ };
2608
+ }
2609
+ const uo = {
2610
+ create: oo,
2611
+ createGroup: Ht,
2612
+ setGlobalSound: xt,
2613
+ isGlobalSoundEnabled: Yt,
2614
+ setGlobalVolume: Ft,
2615
+ getGlobalVolume: Et,
2616
+ supportsHover: Qe,
2617
+ isTouchDevice: kt
2618
+ };
2619
+ export {
2620
+ Zt as ALL_STATES,
2621
+ _t as ALL_WANDERABLE_STATES,
2622
+ Nt as AUTONOMOUS_STATES,
2623
+ Bt as DEFAULT_STEP_MS,
2624
+ zt as DragPhysics,
2625
+ lt as EMOJI_BRIX,
2626
+ Ce as EMOJI_COTA,
2627
+ at as EMOJI_DOZY,
2628
+ rt as EMOJI_FIDGE,
2629
+ ht as EMOJI_KNOT,
2630
+ nt as EMOJI_LUMO,
2631
+ Re as EMOJI_MOCHI,
2632
+ st as EMOJI_NIMA,
2633
+ dt as EMOJI_PIP,
2634
+ ut as EMOJI_SNUG,
2635
+ it as EMOJI_SURI,
2636
+ mt as EMOJI_VOID,
2637
+ ct as EMOJI_WILT,
2638
+ ot as EMOJI_ZUMI,
2639
+ Vt as EmojiGroup,
2640
+ je as IDLE_MOTIONS,
2641
+ oe as LIB,
2642
+ Rt as PERSONALITY_DRIVEN_STATES,
2643
+ At as ParticleEmitter,
2644
+ to as SIZE_PRESETS,
2645
+ Ve as STATE_GROUPS,
2646
+ Wt as STATE_MOTIONS,
2647
+ ro as STATE_THEME_MAP,
2648
+ St as SoundEngine,
2649
+ $t as StateManager,
2650
+ uo as Wissive,
2651
+ Gt as applyIdleMotion,
2652
+ Ot as applyStateMotion,
2653
+ Tt as attachEventListeners,
2654
+ It as blendColors,
2655
+ Jt as buildCustomEmoji,
2656
+ _e as buildFace,
2657
+ no as checkContrast,
2658
+ ho as createCustomEmoji,
2659
+ oo as createEmoji,
2660
+ Ht as createEmojiGroup,
2661
+ ft as createMultiSpring,
2662
+ jt as createSequencePlayer,
2663
+ uo as default,
2664
+ Dt as getContrastRatio,
2665
+ We as getEmojiDefinition,
2666
+ Et as getGlobalVolume,
2667
+ Oe as getLuminance,
2668
+ gt as getSilhouettePath,
2669
+ lo as getThemeForState,
2670
+ Yt as isGlobalSoundEnabled,
2671
+ Pt as isReducedMotionPreferred,
2672
+ kt as isTouchDevice,
2673
+ co as loadCustomEmoji,
2674
+ yt as makeSpring,
2675
+ qt as pickWithoutRepeat,
2676
+ ao as renderSvgElement,
2677
+ Qt as resolveAutonomousStatePool,
2678
+ Ze as resolveSize,
2679
+ Kt as saveCustomEmoji,
2680
+ xt as setGlobalSound,
2681
+ Ft as setGlobalVolume,
2682
+ O as sharedLoop,
2683
+ U as soundEngine,
2684
+ Xt as subscribeToReducedMotion,
2685
+ Qe as supportsHover
2686
+ };
2687
+ //# sourceMappingURL=wissive.js.map