@factorialco/f0-react 1.385.0 → 1.386.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DataCollectionStorageProvider-CGbqg3A9.js → DataCollectionStorageProvider-qIZ0usNU.js} +16323 -18366
- package/dist/{F0AiChat-Ddo83UfP.js → F0AiChat-c00n76c6.js} +39717 -36870
- package/dist/{F0HILActionConfirmation-C475SHSS.js → F0HILActionConfirmation-B5YWkhyV.js} +156 -155
- package/dist/ai.d.ts +193 -12
- package/dist/ai.js +48 -45
- package/dist/experimental.d.ts +71 -5
- package/dist/experimental.js +267 -267
- package/dist/f0.d.ts +193 -12
- package/dist/f0.js +213 -210
- package/dist/i18n-provider-defaults.d.ts +8 -5
- package/dist/i18n-provider-defaults.js +3 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useInsertionEffect as
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as G, jsxs as le } from "react/jsx-runtime";
|
|
2
|
+
import { useInsertionEffect as Ge, createContext as ke, useContext as $e, useRef as _, useEffect as ne, useState as _e, useCallback as Ye, useMemo as ze } from "react";
|
|
3
|
+
import { G as qe, J as We, K as He, M as je, N as Ne, Q as Ke, R as Qe, V as Je, W as Ze, X as et, Y as Ce, Z as tt, _ as rt, $ as nt, a0 as it, a1 as ot, a2 as at, a3 as st, a4 as ie, a5 as ct, a6 as ut, a7 as lt, a8 as ft, a9 as mt, aa as dt, ab as fe, ac as ht } from "./F0AiChat-c00n76c6.js";
|
|
4
4
|
import { useTrackVolume as pt } from "@livekit/components-react";
|
|
5
5
|
function vt(t, e, r) {
|
|
6
|
-
|
|
6
|
+
Ge(() => t.on(e, r), [t, e, r]);
|
|
7
7
|
}
|
|
8
8
|
function ce(t) {
|
|
9
9
|
return typeof t == "object" && !Array.isArray(t);
|
|
@@ -24,14 +24,14 @@ const yt = (t, e, r) => {
|
|
|
24
24
|
function Oe(t, e) {
|
|
25
25
|
return We(t) ? t[yt(0, t.length, e)] : t;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function Et(t, e, r) {
|
|
28
28
|
for (let n = 0; n < t.length; n++) {
|
|
29
29
|
const l = t[n];
|
|
30
30
|
l.at > e && l.at < r && (je(t, l), n--);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
33
|
+
function Tt(t, e, r, n, l, f) {
|
|
34
|
+
Et(t, l, f);
|
|
35
35
|
for (let h = 0; h < e.length; h++)
|
|
36
36
|
t.push({
|
|
37
37
|
value: e[h],
|
|
@@ -39,96 +39,96 @@ function Et(t, e, r, n, l, f) {
|
|
|
39
39
|
easing: Oe(r, h)
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function wt(t, e) {
|
|
43
43
|
for (let r = 0; r < t.length; r++)
|
|
44
44
|
t[r] = t[r] / (e + 1);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function At(t, e) {
|
|
47
47
|
return t.at === e.at ? t.value === null ? 1 : e.value === null ? -1 : 0 : t.at - e.at;
|
|
48
48
|
}
|
|
49
49
|
const St = "easeInOut", xt = 20;
|
|
50
50
|
function bt(t, { defaultTransition: e = {}, ...r } = {}, n, l) {
|
|
51
|
-
const f = e.duration || 0.3, h = /* @__PURE__ */ new Map(),
|
|
52
|
-
let y = 0,
|
|
51
|
+
const f = e.duration || 0.3, h = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), g = {}, b = /* @__PURE__ */ new Map();
|
|
52
|
+
let y = 0, E = 0, x = 0;
|
|
53
53
|
for (let c = 0; c < t.length; c++) {
|
|
54
54
|
const v = t[c];
|
|
55
55
|
if (typeof v == "string") {
|
|
56
|
-
b.set(v,
|
|
56
|
+
b.set(v, E);
|
|
57
57
|
continue;
|
|
58
58
|
} else if (!Array.isArray(v)) {
|
|
59
|
-
b.set(v.name, me(
|
|
59
|
+
b.set(v.name, me(E, v.at, y, b));
|
|
60
60
|
continue;
|
|
61
61
|
}
|
|
62
62
|
let [N, m, R = {}] = v;
|
|
63
|
-
R.at !== void 0 && (
|
|
64
|
-
let
|
|
65
|
-
const C = (
|
|
66
|
-
const
|
|
63
|
+
R.at !== void 0 && (E = me(E, R.at, y, b));
|
|
64
|
+
let F = 0;
|
|
65
|
+
const C = (A, S, I, L = 0, V = 0) => {
|
|
66
|
+
const T = Rt(A), { delay: d = 0, times: P = Ke(T), type: W = "keyframes", repeat: k, repeatType: ue, repeatDelay: oe = 0, ...H } = S;
|
|
67
67
|
let { ease: U = e.ease || "easeOut", duration: M } = S;
|
|
68
|
-
const $ = typeof d == "function" ? d(
|
|
68
|
+
const $ = typeof d == "function" ? d(L, V) : d, Q = T.length, J = Ze(W) ? W : l?.[W];
|
|
69
69
|
if (Q <= 2 && J) {
|
|
70
|
-
let
|
|
71
|
-
if (Q === 2 &&
|
|
72
|
-
const q =
|
|
73
|
-
|
|
70
|
+
let Y = 100;
|
|
71
|
+
if (Q === 2 && Ft(T)) {
|
|
72
|
+
const q = T[1] - T[0];
|
|
73
|
+
Y = Math.abs(q);
|
|
74
74
|
}
|
|
75
|
-
const
|
|
76
|
-
M !== void 0 && (
|
|
77
|
-
const j = Qe(
|
|
75
|
+
const z = { ...H };
|
|
76
|
+
M !== void 0 && (z.duration = et(M));
|
|
77
|
+
const j = Qe(z, Y, J);
|
|
78
78
|
U = j.ease, M = j.duration;
|
|
79
79
|
}
|
|
80
80
|
M ?? (M = f);
|
|
81
|
-
const Z =
|
|
81
|
+
const Z = E + $;
|
|
82
82
|
P.length === 1 && P[0] === 0 && (P[1] = 1);
|
|
83
|
-
const ee = P.length -
|
|
84
|
-
if (ee > 0 && Je(P, ee),
|
|
83
|
+
const ee = P.length - T.length;
|
|
84
|
+
if (ee > 0 && Je(P, ee), T.length === 1 && T.unshift(null), k) {
|
|
85
85
|
Ce(k < xt, "Repeat count too high, must be less than 20"), M = gt(M, k);
|
|
86
|
-
const
|
|
86
|
+
const Y = [...T], z = [...P];
|
|
87
87
|
U = Array.isArray(U) ? [...U] : [U];
|
|
88
88
|
const j = [...U];
|
|
89
89
|
for (let q = 0; q < k; q++) {
|
|
90
|
-
|
|
91
|
-
for (let i = 0; i <
|
|
92
|
-
P.push(
|
|
90
|
+
T.push(...Y);
|
|
91
|
+
for (let i = 0; i < Y.length; i++)
|
|
92
|
+
P.push(z[i] + (q + 1)), U.push(i === 0 ? "linear" : Oe(j, i - 1));
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
wt(P, k);
|
|
95
95
|
}
|
|
96
96
|
const te = Z + M;
|
|
97
|
-
|
|
97
|
+
Tt(I, T, U, P, Z, te), F = Math.max($ + M, F), x = Math.max(te, x);
|
|
98
98
|
};
|
|
99
99
|
if (Ne(N)) {
|
|
100
|
-
const
|
|
101
|
-
C(m, R, he("default",
|
|
100
|
+
const A = de(N, w);
|
|
101
|
+
C(m, R, he("default", A));
|
|
102
102
|
} else {
|
|
103
|
-
const
|
|
103
|
+
const A = Ue(N, m, n, g), S = A.length;
|
|
104
104
|
for (let I = 0; I < S; I++) {
|
|
105
105
|
m = m, R = R;
|
|
106
|
-
const
|
|
107
|
-
for (const
|
|
108
|
-
C(m[
|
|
106
|
+
const L = A[I], V = de(L, w);
|
|
107
|
+
for (const T in m)
|
|
108
|
+
C(m[T], It(R, T), he(T, V), I, S);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
y =
|
|
111
|
+
y = E, E += F;
|
|
112
112
|
}
|
|
113
|
-
return
|
|
113
|
+
return w.forEach((c, v) => {
|
|
114
114
|
for (const N in c) {
|
|
115
115
|
const m = c[N];
|
|
116
|
-
m.sort(
|
|
117
|
-
const R = [],
|
|
116
|
+
m.sort(At);
|
|
117
|
+
const R = [], F = [], C = [];
|
|
118
118
|
for (let S = 0; S < m.length; S++) {
|
|
119
|
-
const { at: I, value:
|
|
120
|
-
R.push(
|
|
119
|
+
const { at: I, value: L, easing: V } = m[S];
|
|
120
|
+
R.push(L), F.push(tt(0, x, I)), C.push(V || "easeOut");
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
F[0] !== 0 && (F.unshift(0), R.unshift(R[0]), C.unshift(St)), F[F.length - 1] !== 1 && (F.push(1), R.push(null)), h.has(v) || h.set(v, {
|
|
123
123
|
keyframes: {},
|
|
124
124
|
transition: {}
|
|
125
125
|
});
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
const A = h.get(v);
|
|
127
|
+
A.keyframes[N] = R, A.transition[N] = {
|
|
128
128
|
...e,
|
|
129
129
|
duration: x,
|
|
130
130
|
ease: C,
|
|
131
|
-
times:
|
|
131
|
+
times: F,
|
|
132
132
|
...r
|
|
133
133
|
};
|
|
134
134
|
}
|
|
@@ -149,7 +149,7 @@ function It(t, e) {
|
|
|
149
149
|
...t[e]
|
|
150
150
|
} : { ...t };
|
|
151
151
|
}
|
|
152
|
-
const
|
|
152
|
+
const Lt = (t) => typeof t == "number", Ft = (t) => t.every(Lt);
|
|
153
153
|
function Mt(t, e) {
|
|
154
154
|
return t in e;
|
|
155
155
|
}
|
|
@@ -222,19 +222,19 @@ function De(t, e, r, n) {
|
|
|
222
222
|
else {
|
|
223
223
|
const f = Ue(t, e, n), h = f.length;
|
|
224
224
|
Ce(!!h, "No valid elements provided.");
|
|
225
|
-
for (let
|
|
226
|
-
const g = f[
|
|
225
|
+
for (let w = 0; w < h; w++) {
|
|
226
|
+
const g = f[w], b = g instanceof Element ? Nt : Ct;
|
|
227
227
|
ie.has(g) || b(g);
|
|
228
|
-
const y = ie.get(g),
|
|
229
|
-
"delay" in
|
|
228
|
+
const y = ie.get(g), E = { ...r };
|
|
229
|
+
"delay" in E && typeof E.delay == "function" && (E.delay = E.delay(w, h)), l.push(...ut(y, { ...e, transition: E }, {}));
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
return l;
|
|
233
233
|
}
|
|
234
234
|
function Ot(t, e, r) {
|
|
235
235
|
const n = [];
|
|
236
|
-
return bt(t, e, r, { spring: lt }).forEach(({ keyframes: f, transition: h },
|
|
237
|
-
n.push(...De(
|
|
236
|
+
return bt(t, e, r, { spring: lt }).forEach(({ keyframes: f, transition: h }, w) => {
|
|
237
|
+
n.push(...De(w, f, h));
|
|
238
238
|
}), n;
|
|
239
239
|
}
|
|
240
240
|
class Dt {
|
|
@@ -318,7 +318,7 @@ function Bt(t) {
|
|
|
318
318
|
}
|
|
319
319
|
return e;
|
|
320
320
|
}
|
|
321
|
-
const
|
|
321
|
+
const Xt = Bt(), mr = ["xs", "sm", "md", "lg"], dr = [
|
|
322
322
|
"inProgress",
|
|
323
323
|
"executing",
|
|
324
324
|
"completed"
|
|
@@ -337,8 +337,6 @@ const Gt = Bt(), mr = ["xs", "sm", "md", "lg"], dr = [
|
|
|
337
337
|
thoughtsGroupTitle: "Reflection",
|
|
338
338
|
resourcesGroupTitle: "Resources",
|
|
339
339
|
thinking: "Thinking...",
|
|
340
|
-
exportTable: "Download table",
|
|
341
|
-
generatedTableFilename: "OneGeneratedTable",
|
|
342
340
|
feedbackModal: {
|
|
343
341
|
positive: {
|
|
344
342
|
title: "What did you like about this response?",
|
|
@@ -351,16 +349,19 @@ const Gt = Bt(), mr = ["xs", "sm", "md", "lg"], dr = [
|
|
|
351
349
|
placeholder: "Share what didn't work"
|
|
352
350
|
}
|
|
353
351
|
},
|
|
352
|
+
dataDownloadPreview: "Preview {{shown}} of {{total}} rows — download the Excel to see all data.",
|
|
354
353
|
expandChat: "Expand chat",
|
|
355
354
|
collapseChat: "Collapse chat",
|
|
356
|
-
ask: "Ask One"
|
|
355
|
+
ask: "Ask One",
|
|
356
|
+
viewProfile: "View profile",
|
|
357
|
+
tools: "Tools"
|
|
357
358
|
}
|
|
358
359
|
}, Pe = ke(null);
|
|
359
360
|
function pr({
|
|
360
361
|
children: t,
|
|
361
362
|
translations: e
|
|
362
363
|
}) {
|
|
363
|
-
return /* @__PURE__ */
|
|
364
|
+
return /* @__PURE__ */ G(Pe.Provider, { value: e, children: t });
|
|
364
365
|
}
|
|
365
366
|
function vr() {
|
|
366
367
|
const t = $e(Pe);
|
|
@@ -370,7 +371,7 @@ function vr() {
|
|
|
370
371
|
);
|
|
371
372
|
return t;
|
|
372
373
|
}
|
|
373
|
-
const pe = ["lowp", "mediump", "highp"],
|
|
374
|
+
const pe = ["lowp", "mediump", "highp"], Gt = `
|
|
374
375
|
void main(void){
|
|
375
376
|
vec4 color = vec4(0.0,0.0,0.0,1.0);
|
|
376
377
|
mainImage( color, gl_FragCoord.xy );
|
|
@@ -382,11 +383,11 @@ void main(void){
|
|
|
382
383
|
}`, ve = `attribute vec3 aVertexPosition;
|
|
383
384
|
void main(void) {
|
|
384
385
|
gl_Position = vec4(aVertexPosition, 1.0);
|
|
385
|
-
}`, ge = "iTime", ye = "iTimeDelta",
|
|
386
|
-
function
|
|
386
|
+
}`, ge = "iTime", ye = "iTimeDelta", Ee = "iDate", Te = "iFrame", we = "iMouse", Ae = "iResolution", $t = "iChannel", Se = "iChannelResolution", xe = "iDeviceOrientation";
|
|
387
|
+
function Yt(t, e) {
|
|
387
388
|
return t.includes("Matrix") && Array.isArray(e);
|
|
388
389
|
}
|
|
389
|
-
function
|
|
390
|
+
function zt(t, e) {
|
|
390
391
|
return t.includes("v") && Array.isArray(e) && e.length > Number.parseInt(t.charAt(0));
|
|
391
392
|
}
|
|
392
393
|
function qt(t, e) {
|
|
@@ -476,7 +477,7 @@ const Wt = (t, e, r, n) => {
|
|
|
476
477
|
return "mat4";
|
|
477
478
|
default:
|
|
478
479
|
console.error(
|
|
479
|
-
|
|
480
|
+
X(
|
|
480
481
|
`The uniform type "${t}" is not valid, please make sure your uniform type is valid`
|
|
481
482
|
)
|
|
482
483
|
);
|
|
@@ -501,12 +502,12 @@ class Kt {
|
|
|
501
502
|
this.gl = e;
|
|
502
503
|
}
|
|
503
504
|
updateTexture = (e, r, n) => {
|
|
504
|
-
const { gl: l } = this, f = 0, h = l.RGBA,
|
|
505
|
+
const { gl: l } = this, f = 0, h = l.RGBA, w = l.RGBA, g = l.UNSIGNED_BYTE;
|
|
505
506
|
l.bindTexture(l.TEXTURE_2D, e), l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, n), l.texImage2D(
|
|
506
507
|
l.TEXTURE_2D,
|
|
507
508
|
f,
|
|
508
509
|
h,
|
|
509
|
-
|
|
510
|
+
w,
|
|
510
511
|
g,
|
|
511
512
|
r
|
|
512
513
|
);
|
|
@@ -539,7 +540,7 @@ class Kt {
|
|
|
539
540
|
this.pow2canvas.width,
|
|
540
541
|
this.pow2canvas.height
|
|
541
542
|
), console.warn(
|
|
542
|
-
|
|
543
|
+
X(
|
|
543
544
|
`Image is not power of two ${e.width} x ${e.height}. Resized to ${this.pow2canvas.width} x ${this.pow2canvas.height};`
|
|
544
545
|
)
|
|
545
546
|
), this.pow2canvas) : e;
|
|
@@ -549,13 +550,13 @@ class Kt {
|
|
|
549
550
|
wrapS: l,
|
|
550
551
|
wrapT: f,
|
|
551
552
|
minFilter: h,
|
|
552
|
-
magFilter:
|
|
553
|
+
magFilter: w,
|
|
553
554
|
flipY: g = -1
|
|
554
555
|
} = e;
|
|
555
556
|
if (!n)
|
|
556
557
|
return Promise.reject(
|
|
557
558
|
new Error(
|
|
558
|
-
|
|
559
|
+
X(
|
|
559
560
|
"Missing url, please make sure to pass the url of your texture { url: ... }"
|
|
560
561
|
)
|
|
561
562
|
)
|
|
@@ -564,41 +565,41 @@ class Kt {
|
|
|
564
565
|
if (b === null && y === null)
|
|
565
566
|
return Promise.reject(
|
|
566
567
|
new Error(
|
|
567
|
-
|
|
568
|
+
X(
|
|
568
569
|
`Please upload a video or an image with a valid format (url: ${n})`
|
|
569
570
|
)
|
|
570
571
|
)
|
|
571
572
|
);
|
|
572
|
-
Object.assign(this, { url: n, wrapS: l, wrapT: f, minFilter: h, magFilter:
|
|
573
|
-
const
|
|
573
|
+
Object.assign(this, { url: n, wrapS: l, wrapT: f, minFilter: h, magFilter: w, flipY: g });
|
|
574
|
+
const E = 0, x = r.RGBA, c = 1, v = 1, N = 0, m = r.RGBA, R = r.UNSIGNED_BYTE, F = new Uint8Array([255, 255, 255, 0]), C = r.createTexture();
|
|
574
575
|
if (r.bindTexture(r.TEXTURE_2D, C), r.texImage2D(
|
|
575
576
|
r.TEXTURE_2D,
|
|
576
|
-
|
|
577
|
+
E,
|
|
577
578
|
x,
|
|
578
579
|
c,
|
|
579
580
|
v,
|
|
580
581
|
N,
|
|
581
582
|
m,
|
|
582
583
|
R,
|
|
583
|
-
|
|
584
|
+
F
|
|
584
585
|
), y) {
|
|
585
|
-
const
|
|
586
|
-
return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR), this._webglTexture = C, this.source =
|
|
586
|
+
const L = this.setupVideo(n);
|
|
587
|
+
return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR), this._webglTexture = C, this.source = L, this.isVideo = !0, L.play().then(() => this);
|
|
587
588
|
}
|
|
588
|
-
async function
|
|
589
|
-
return new Promise((
|
|
590
|
-
const
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
},
|
|
594
|
-
V(new Error(
|
|
595
|
-
},
|
|
589
|
+
async function A() {
|
|
590
|
+
return new Promise((L, V) => {
|
|
591
|
+
const T = new Image();
|
|
592
|
+
T.crossOrigin = "anonymous", T.onload = () => {
|
|
593
|
+
L(T);
|
|
594
|
+
}, T.onerror = () => {
|
|
595
|
+
V(new Error(X(`failed loading url: ${n}`)));
|
|
596
|
+
}, T.src = n ?? "";
|
|
596
597
|
});
|
|
597
598
|
}
|
|
598
|
-
let S = await
|
|
599
|
+
let S = await A(), I = (S.width & S.width - 1) === 0 && (S.height & S.height - 1) === 0;
|
|
599
600
|
return (e.wrapS !== Re || e.wrapT !== Re || e.minFilter !== be && e.minFilter !== se) && !I && (S = this.makePowerOf2(S), I = !0), r.bindTexture(r.TEXTURE_2D, C), r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, g), r.texImage2D(
|
|
600
601
|
r.TEXTURE_2D,
|
|
601
|
-
|
|
602
|
+
E,
|
|
602
603
|
x,
|
|
603
604
|
m,
|
|
604
605
|
R,
|
|
@@ -622,13 +623,13 @@ class Kt {
|
|
|
622
623
|
), this._webglTexture = C, this.source = S, this.isVideo = !1, this.isLoaded = !0, this.width = S.width || 0, this.height = S.height || 0, this;
|
|
623
624
|
};
|
|
624
625
|
}
|
|
625
|
-
const
|
|
626
|
+
const X = (t) => `react-shaders: ${t}`, Le = (t) => {
|
|
626
627
|
if ("changedTouches" in t) {
|
|
627
628
|
const e = t.changedTouches[0];
|
|
628
629
|
return [e?.clientX ?? 0, e?.clientY ?? 0];
|
|
629
630
|
}
|
|
630
631
|
return [t.clientX, t.clientY];
|
|
631
|
-
},
|
|
632
|
+
}, Fe = (t, e, r) => t * (1 - r) + e * r, Qt = (t, e, r) => r > 0 ? t.substring(0, r) + e + t.substring(r, t.length) : e + t;
|
|
632
633
|
function Jt({
|
|
633
634
|
fs: t,
|
|
634
635
|
vs: e = ve,
|
|
@@ -637,20 +638,20 @@ function Jt({
|
|
|
637
638
|
clearColor: l = [0, 0, 0, 1],
|
|
638
639
|
precision: f = "highp",
|
|
639
640
|
style: h,
|
|
640
|
-
contextAttributes:
|
|
641
|
+
contextAttributes: w = {},
|
|
641
642
|
lerp: g = 1,
|
|
642
643
|
devicePixelRatio: b = 1,
|
|
643
644
|
onDoneLoadingTextures: y,
|
|
644
|
-
onError:
|
|
645
|
+
onError: E = console.error,
|
|
645
646
|
onWarning: x = console.warn
|
|
646
647
|
}) {
|
|
647
|
-
const c = _(null), v = _(null), N = _(null), m = _(null), R = _(void 0),
|
|
648
|
+
const c = _(null), v = _(null), N = _(null), m = _(null), R = _(void 0), F = _(void 0), C = _(!1), A = _(void 0), S = _(0), I = _([0, 0]), L = _([]), V = _(0), T = _(void 0), d = _({
|
|
648
649
|
[ge]: { type: "float", isNeeded: !1, value: 0 },
|
|
649
650
|
[ye]: { type: "float", isNeeded: !1, value: 0 },
|
|
650
|
-
[
|
|
651
|
-
[
|
|
652
|
-
[
|
|
653
|
-
[
|
|
651
|
+
[Ee]: { type: "vec4", isNeeded: !1, value: [0, 0, 0, 0] },
|
|
652
|
+
[we]: { type: "vec4", isNeeded: !1, value: [0, 0, 0, 0] },
|
|
653
|
+
[Ae]: { type: "vec2", isNeeded: !1, value: [0, 0] },
|
|
654
|
+
[Te]: { type: "int", isNeeded: !1, value: 0 },
|
|
654
655
|
[xe]: {
|
|
655
656
|
type: "vec4",
|
|
656
657
|
isNeeded: !1,
|
|
@@ -662,9 +663,9 @@ function Jt({
|
|
|
662
663
|
const p = Array.isArray(s.value) ? s.value : s.value = [];
|
|
663
664
|
p[a * 3] = o * b, p[a * 3 + 1] = u * b, p[a * 3 + 2] = 0;
|
|
664
665
|
}, k = () => {
|
|
665
|
-
c.current && (v.current = c.current.getContext("webgl",
|
|
666
|
+
c.current && (v.current = c.current.getContext("webgl", w) || c.current.getContext(
|
|
666
667
|
"experimental-webgl",
|
|
667
|
-
|
|
668
|
+
w
|
|
668
669
|
), v.current?.getExtension("OES_standard_derivatives"), v.current?.getExtension("EXT_shader_texture_lod"));
|
|
669
670
|
}, ue = () => {
|
|
670
671
|
const i = v.current;
|
|
@@ -696,13 +697,13 @@ function Jt({
|
|
|
696
697
|
window.orientation ?? 0
|
|
697
698
|
];
|
|
698
699
|
}, H = (i) => {
|
|
699
|
-
const [a = 0, o = 0] =
|
|
700
|
+
const [a = 0, o = 0] = Le(i), u = a - (A.current?.left ?? 0) - window.pageXOffset, s = (A.current?.height ?? 0) - o - (A.current?.top ?? 0) - window.pageYOffset;
|
|
700
701
|
C.current = !0;
|
|
701
702
|
const p = Array.isArray(d.current.iMouse?.value) ? d.current.iMouse.value : void 0;
|
|
702
703
|
p && (p[2] = u, p[3] = s), I.current[0] = u, I.current[1] = s;
|
|
703
704
|
}, U = (i) => {
|
|
704
|
-
|
|
705
|
-
const [a = 0, o = 0] =
|
|
705
|
+
A.current = c.current?.getBoundingClientRect();
|
|
706
|
+
const [a = 0, o = 0] = Le(i), u = a - (A.current?.left ?? 0), s = (A.current?.height ?? 0) - o - (A.current?.top ?? 0);
|
|
706
707
|
if (g !== 1)
|
|
707
708
|
I.current[0] = u, I.current[1] = s;
|
|
708
709
|
else {
|
|
@@ -715,16 +716,16 @@ function Jt({
|
|
|
715
716
|
}, $ = () => {
|
|
716
717
|
const i = v.current;
|
|
717
718
|
if (!i) return;
|
|
718
|
-
|
|
719
|
+
A.current = c.current?.getBoundingClientRect();
|
|
719
720
|
const a = b, o = Math.floor(
|
|
720
|
-
(
|
|
721
|
+
(A.current?.width ?? 1) * a
|
|
721
722
|
), u = Math.floor(
|
|
722
|
-
(
|
|
723
|
+
(A.current?.height ?? 1) * a
|
|
723
724
|
);
|
|
724
725
|
if (i.canvas.width = o, i.canvas.height = u, d.current.iResolution?.isNeeded && m.current) {
|
|
725
726
|
const s = i.getUniformLocation(
|
|
726
727
|
m.current,
|
|
727
|
-
|
|
728
|
+
Ae
|
|
728
729
|
);
|
|
729
730
|
i.uniform2fv(s, [i.canvas.width, i.canvas.height]);
|
|
730
731
|
}
|
|
@@ -734,10 +735,10 @@ function Jt({
|
|
|
734
735
|
const u = o.createShader(i);
|
|
735
736
|
if (!u) return null;
|
|
736
737
|
if (o.shaderSource(u, a), o.compileShader(u), !o.getShaderParameter(u, o.COMPILE_STATUS)) {
|
|
737
|
-
x?.(
|
|
738
|
+
x?.(X(`Error compiling the shader:
|
|
738
739
|
${a}`));
|
|
739
740
|
const s = o.getShaderInfoLog(u);
|
|
740
|
-
o.deleteShader(u),
|
|
741
|
+
o.deleteShader(u), E?.(X(`Shader compiler log: ${s}`));
|
|
741
742
|
}
|
|
742
743
|
return u;
|
|
743
744
|
}, J = (i, a) => {
|
|
@@ -746,8 +747,8 @@ ${a}`));
|
|
|
746
747
|
const u = Q(o.FRAGMENT_SHADER, i), s = Q(o.VERTEX_SHADER, a);
|
|
747
748
|
if (m.current = o.createProgram(), !(!m.current || !s || !u)) {
|
|
748
749
|
if (o.attachShader(m.current, s), o.attachShader(m.current, u), o.linkProgram(m.current), !o.getProgramParameter(m.current, o.LINK_STATUS)) {
|
|
749
|
-
|
|
750
|
-
|
|
750
|
+
E?.(
|
|
751
|
+
X(
|
|
751
752
|
`Unable to initialize the shader program: ${o.getProgramInfoLog(
|
|
752
753
|
m.current
|
|
753
754
|
)}`
|
|
@@ -768,10 +769,10 @@ ${a}`));
|
|
|
768
769
|
const { value: o, type: u } = a, s = Ht(u);
|
|
769
770
|
if (!s) continue;
|
|
770
771
|
const p = {};
|
|
771
|
-
if (
|
|
772
|
+
if (Yt(u, o)) {
|
|
772
773
|
const O = u.length, B = Number.parseInt(u.charAt(O - 3)), K = Math.floor(o.length / (B * B));
|
|
773
774
|
o.length > B * B && (p.arraySize = `[${K}]`);
|
|
774
|
-
} else
|
|
775
|
+
} else zt(u, o) && (p.arraySize = `[${Math.floor(o.length / Number.parseInt(u.charAt(0)))}]`);
|
|
775
776
|
d.current[i] = {
|
|
776
777
|
type: s,
|
|
777
778
|
isNeeded: !1,
|
|
@@ -793,21 +794,21 @@ ${a}`));
|
|
|
793
794
|
(o, u) => (d.current[`${$t}${u}`] = {
|
|
794
795
|
type: "sampler2D",
|
|
795
796
|
isNeeded: !1
|
|
796
|
-
}, W(o, u),
|
|
797
|
+
}, W(o, u), L.current[u] = new Kt(i), L.current[u]?.load(o).then((s) => {
|
|
797
798
|
W(s, u);
|
|
798
799
|
}))
|
|
799
800
|
);
|
|
800
801
|
Promise.all(a).then(() => {
|
|
801
802
|
y && y();
|
|
802
803
|
}).catch((o) => {
|
|
803
|
-
|
|
804
|
+
E?.(o), y && y();
|
|
804
805
|
});
|
|
805
806
|
} else y && y();
|
|
806
807
|
}, te = (i) => {
|
|
807
808
|
const a = pe.includes(f ?? "highp"), o = `precision ${a ? f : pe[1]} float;
|
|
808
809
|
`;
|
|
809
810
|
a || x?.(
|
|
810
|
-
|
|
811
|
+
X(
|
|
811
812
|
`wrong precision type ${f}, please make sure to pass one of a valid precision lowp, mediump, highp, by default you shader precision will be set to highp.`
|
|
812
813
|
)
|
|
813
814
|
);
|
|
@@ -824,8 +825,8 @@ ${a}`));
|
|
|
824
825
|
u.lastIndexOf(o) + o.length
|
|
825
826
|
), O.isNeeded = !0;
|
|
826
827
|
}
|
|
827
|
-
return i.includes("mainImage") && (u = u.concat(
|
|
828
|
-
},
|
|
828
|
+
return i.includes("mainImage") && (u = u.concat(Gt)), u;
|
|
829
|
+
}, Y = (i) => {
|
|
829
830
|
const a = v.current;
|
|
830
831
|
if (!a || !m.current) return;
|
|
831
832
|
const o = V.current ? (i - V.current) / 1e3 : 0;
|
|
@@ -852,7 +853,7 @@ ${a}`));
|
|
|
852
853
|
if (d.current.iMouse?.isNeeded) {
|
|
853
854
|
const s = a.getUniformLocation(
|
|
854
855
|
m.current,
|
|
855
|
-
|
|
856
|
+
we
|
|
856
857
|
);
|
|
857
858
|
a.uniform4fv(s, d.current.iMouse.value);
|
|
858
859
|
}
|
|
@@ -893,37 +894,37 @@ ${a}`));
|
|
|
893
894
|
if (d.current.iDate?.isNeeded) {
|
|
894
895
|
const s = /* @__PURE__ */ new Date(), p = s.getMonth() + 1, O = s.getDate(), B = s.getFullYear(), K = s.getHours() * 60 * 60 + s.getMinutes() * 60 + s.getSeconds() + s.getMilliseconds() * 1e-3, ae = a.getUniformLocation(
|
|
895
896
|
m.current,
|
|
896
|
-
|
|
897
|
+
Ee
|
|
897
898
|
);
|
|
898
899
|
a.uniform4fv(ae, [B, p, O, K]);
|
|
899
900
|
}
|
|
900
901
|
if (d.current.iFrame?.isNeeded) {
|
|
901
902
|
const s = a.getUniformLocation(
|
|
902
903
|
m.current,
|
|
903
|
-
|
|
904
|
+
Te
|
|
904
905
|
), p = d.current.iFrame.value;
|
|
905
906
|
a.uniform1i(s, p), d.current.iFrame.value = p + 1;
|
|
906
907
|
}
|
|
907
|
-
if (
|
|
908
|
-
for (let s = 0; s <
|
|
909
|
-
const p =
|
|
908
|
+
if (L.current.length > 0)
|
|
909
|
+
for (let s = 0; s < L.current.length; s++) {
|
|
910
|
+
const p = L.current[s];
|
|
910
911
|
if (!p) return;
|
|
911
912
|
const { isVideo: O, _webglTexture: B, source: K, flipY: ae, isLoaded: Be } = p;
|
|
912
913
|
if (!Be || !B || !K) return;
|
|
913
914
|
if (d.current[`iChannel${s}`]?.isNeeded) {
|
|
914
915
|
if (!m.current) return;
|
|
915
|
-
const
|
|
916
|
+
const Xe = a.getUniformLocation(
|
|
916
917
|
m.current,
|
|
917
918
|
`iChannel${s}`
|
|
918
919
|
);
|
|
919
|
-
a.activeTexture(a.TEXTURE0 + s), a.bindTexture(a.TEXTURE_2D, B), a.uniform1i(
|
|
920
|
+
a.activeTexture(a.TEXTURE0 + s), a.bindTexture(a.TEXTURE_2D, B), a.uniform1i(Xe, s), O && p.updateTexture(
|
|
920
921
|
B,
|
|
921
922
|
K,
|
|
922
923
|
ae
|
|
923
924
|
);
|
|
924
925
|
}
|
|
925
926
|
}
|
|
926
|
-
},
|
|
927
|
+
}, z = (i) => {
|
|
927
928
|
const a = v.current;
|
|
928
929
|
if (!a) return;
|
|
929
930
|
a.viewport(0, 0, a.drawingBufferWidth, a.drawingBufferHeight), a.clear(a.COLOR_BUFFER_BIT | a.DEPTH_BUFFER_BIT), a.bindBuffer(a.ARRAY_BUFFER, N.current), a.vertexAttribPointer(
|
|
@@ -933,36 +934,36 @@ ${a}`));
|
|
|
933
934
|
!1,
|
|
934
935
|
0,
|
|
935
936
|
0
|
|
936
|
-
),
|
|
937
|
+
), Y(i), a.drawArrays(a.TRIANGLE_STRIP, 0, 4);
|
|
937
938
|
const o = d.current.iMouse?.value;
|
|
938
939
|
if (d.current.iMouse?.isNeeded && g !== 1 && Array.isArray(o)) {
|
|
939
940
|
const u = o[0] ?? 0, s = o[1] ?? 0;
|
|
940
|
-
o[0] =
|
|
941
|
+
o[0] = Fe(u, I.current[0] ?? 0, g), o[1] = Fe(s, I.current[1] ?? 0, g);
|
|
941
942
|
}
|
|
942
|
-
|
|
943
|
+
F.current = requestAnimationFrame(z);
|
|
943
944
|
}, j = () => {
|
|
944
945
|
const i = { passive: !0 };
|
|
945
946
|
d.current.iMouse?.isNeeded && c.current && (c.current.addEventListener("mousemove", U, i), c.current.addEventListener("mouseout", M, i), c.current.addEventListener("mouseup", M, i), c.current.addEventListener("mousedown", H, i), c.current.addEventListener("touchmove", U, i), c.current.addEventListener("touchend", M, i), c.current.addEventListener("touchstart", H, i)), d.current.iDeviceOrientation?.isNeeded && window.addEventListener(
|
|
946
947
|
"deviceorientation",
|
|
947
948
|
oe,
|
|
948
949
|
i
|
|
949
|
-
), c.current && (
|
|
950
|
+
), c.current && (T.current = new ResizeObserver($), T.current.observe(c.current), window.addEventListener("resize", $, i));
|
|
950
951
|
}, q = () => {
|
|
951
952
|
const i = { passive: !0 };
|
|
952
953
|
d.current.iMouse?.isNeeded && c.current && (c.current.removeEventListener("mousemove", U, i), c.current.removeEventListener("mouseout", M, i), c.current.removeEventListener("mouseup", M, i), c.current.removeEventListener("mousedown", H, i), c.current.removeEventListener("touchmove", U, i), c.current.removeEventListener("touchend", M, i), c.current.removeEventListener("touchstart", H, i)), d.current.iDeviceOrientation?.isNeeded && window.removeEventListener(
|
|
953
954
|
"deviceorientation",
|
|
954
955
|
oe,
|
|
955
956
|
i
|
|
956
|
-
),
|
|
957
|
+
), T.current && (T.current.disconnect(), window.removeEventListener("resize", $, i));
|
|
957
958
|
};
|
|
958
959
|
return ne(() => {
|
|
959
960
|
P.current = n;
|
|
960
961
|
}, [n]), ne(() => {
|
|
961
|
-
const i =
|
|
962
|
+
const i = L.current;
|
|
962
963
|
function a() {
|
|
963
964
|
k();
|
|
964
965
|
const o = v.current;
|
|
965
|
-
o && c.current && (o.clearColor(...l), o.clearDepth(1), o.enable(o.DEPTH_TEST), o.depthFunc(o.LEQUAL), o.viewport(0, 0, c.current.width, c.current.height), c.current.height = c.current.clientHeight, c.current.width = c.current.clientWidth, Z(), ee(), J(te(t || kt), e || ve), ue(), requestAnimationFrame(
|
|
966
|
+
o && c.current && (o.clearColor(...l), o.clearDepth(1), o.enable(o.DEPTH_TEST), o.depthFunc(o.LEQUAL), o.viewport(0, 0, c.current.width, c.current.height), c.current.height = c.current.clientHeight, c.current.width = c.current.clientWidth, Z(), ee(), J(te(t || kt), e || ve), ue(), requestAnimationFrame(z), j(), $());
|
|
966
967
|
}
|
|
967
968
|
return requestAnimationFrame(a), () => {
|
|
968
969
|
const o = v.current;
|
|
@@ -972,9 +973,9 @@ ${a}`));
|
|
|
972
973
|
o.deleteTexture(u._webglTexture);
|
|
973
974
|
m.current = null;
|
|
974
975
|
}
|
|
975
|
-
q(), cancelAnimationFrame(
|
|
976
|
+
q(), cancelAnimationFrame(F.current ?? 0);
|
|
976
977
|
};
|
|
977
|
-
}, []), /* @__PURE__ */
|
|
978
|
+
}, []), /* @__PURE__ */ G(
|
|
978
979
|
"canvas",
|
|
979
980
|
{
|
|
980
981
|
ref: c,
|
|
@@ -1161,9 +1162,9 @@ void mainImage(out vec4 fragColor, in vec2 fragCoord) {
|
|
|
1161
1162
|
function re(t) {
|
|
1162
1163
|
const [e, r] = _e(t), n = ft(t), l = _(null);
|
|
1163
1164
|
vt(n, "change", (h) => r(h));
|
|
1164
|
-
const f =
|
|
1165
|
-
(h,
|
|
1166
|
-
l.current =
|
|
1165
|
+
const f = Ye(
|
|
1166
|
+
(h, w) => {
|
|
1167
|
+
l.current = Xt(n, h, w);
|
|
1167
1168
|
},
|
|
1168
1169
|
[n]
|
|
1169
1170
|
);
|
|
@@ -1174,7 +1175,7 @@ function or(t, e) {
|
|
|
1174
1175
|
value: l,
|
|
1175
1176
|
animate: f,
|
|
1176
1177
|
motionValue: h
|
|
1177
|
-
} = re(nr), { value:
|
|
1178
|
+
} = re(nr), { value: w, animate: g } = re(tr), { value: b, animate: y } = re(rr), { value: E, animate: x } = re(ir), c = pt(e, {
|
|
1178
1179
|
fftSize: 512,
|
|
1179
1180
|
smoothingTimeConstant: 0.55
|
|
1180
1181
|
});
|
|
@@ -1217,9 +1218,9 @@ function or(t, e) {
|
|
|
1217
1218
|
]), {
|
|
1218
1219
|
speed: r,
|
|
1219
1220
|
scale: l,
|
|
1220
|
-
amplitude:
|
|
1221
|
+
amplitude: w,
|
|
1221
1222
|
frequency: b,
|
|
1222
|
-
brightness:
|
|
1223
|
+
brightness: E
|
|
1223
1224
|
};
|
|
1224
1225
|
}
|
|
1225
1226
|
const ar = dt({
|
|
@@ -1254,15 +1255,15 @@ function Ve({
|
|
|
1254
1255
|
scale: l = 0.2,
|
|
1255
1256
|
blur: f = 1,
|
|
1256
1257
|
color: h = "#FF355E",
|
|
1257
|
-
colorShift:
|
|
1258
|
+
colorShift: w = 1,
|
|
1258
1259
|
brightness: g = 1,
|
|
1259
1260
|
themeMode: b = typeof window < "u" && document.documentElement.classList.contains("dark") ? "dark" : "light",
|
|
1260
1261
|
ref: y,
|
|
1261
|
-
className:
|
|
1262
|
+
className: E,
|
|
1262
1263
|
...x
|
|
1263
1264
|
}) {
|
|
1264
|
-
const c =
|
|
1265
|
-
return /* @__PURE__ */
|
|
1265
|
+
const c = ze(() => sr(h), [h]);
|
|
1266
|
+
return /* @__PURE__ */ G("div", { ref: y, className: E, ...x, children: /* @__PURE__ */ G(
|
|
1266
1267
|
Jt,
|
|
1267
1268
|
{
|
|
1268
1269
|
fs: Zt,
|
|
@@ -1287,7 +1288,7 @@ function Ve({
|
|
|
1287
1288
|
// Color variation across layers (0-1)
|
|
1288
1289
|
uSpacing: { type: "1f", value: 0.5 },
|
|
1289
1290
|
// Color palette offset - shifts colors along the gradient (0-1)
|
|
1290
|
-
uColorShift: { type: "1f", value:
|
|
1291
|
+
uColorShift: { type: "1f", value: w },
|
|
1291
1292
|
// Color variation across layers (0-1)
|
|
1292
1293
|
uVariance: { type: "1f", value: 0.1 },
|
|
1293
1294
|
// Smoothing of the aurora (0-1)
|
|
@@ -1316,21 +1317,21 @@ function gr({
|
|
|
1316
1317
|
audioTrack: l,
|
|
1317
1318
|
themeMode: f,
|
|
1318
1319
|
className: h,
|
|
1319
|
-
ref:
|
|
1320
|
+
ref: w,
|
|
1320
1321
|
...g
|
|
1321
1322
|
}) {
|
|
1322
|
-
const { speed: b, scale: y, amplitude:
|
|
1323
|
-
return /* @__PURE__ */
|
|
1323
|
+
const { speed: b, scale: y, amplitude: E, frequency: x, brightness: c } = or(e, l);
|
|
1324
|
+
return /* @__PURE__ */ G(
|
|
1324
1325
|
Ve,
|
|
1325
1326
|
{
|
|
1326
|
-
ref:
|
|
1327
|
+
ref: w,
|
|
1327
1328
|
blur: 0.2,
|
|
1328
1329
|
color: r,
|
|
1329
1330
|
colorShift: n,
|
|
1330
1331
|
speed: b,
|
|
1331
1332
|
scale: y,
|
|
1332
1333
|
themeMode: f,
|
|
1333
|
-
amplitude:
|
|
1334
|
+
amplitude: E,
|
|
1334
1335
|
frequency: x,
|
|
1335
1336
|
brightness: c,
|
|
1336
1337
|
className: mt(
|
|
@@ -1349,9 +1350,9 @@ const yr = ({
|
|
|
1349
1350
|
cancelText: n,
|
|
1350
1351
|
onCancel: l
|
|
1351
1352
|
}) => /* @__PURE__ */ le("div", { className: "flex flex-col gap-2", children: [
|
|
1352
|
-
t && /* @__PURE__ */
|
|
1353
|
+
t && /* @__PURE__ */ G("p", { children: t }),
|
|
1353
1354
|
/* @__PURE__ */ le("div", { className: "flex gap-2", children: [
|
|
1354
|
-
/* @__PURE__ */
|
|
1355
|
+
/* @__PURE__ */ G(
|
|
1355
1356
|
fe,
|
|
1356
1357
|
{
|
|
1357
1358
|
type: "button",
|
|
@@ -1362,7 +1363,7 @@ const yr = ({
|
|
|
1362
1363
|
label: e
|
|
1363
1364
|
}
|
|
1364
1365
|
),
|
|
1365
|
-
/* @__PURE__ */
|
|
1366
|
+
/* @__PURE__ */ G(
|
|
1366
1367
|
fe,
|
|
1367
1368
|
{
|
|
1368
1369
|
type: "button",
|