@cntrl-site/components 1.0.103 → 1.0.105
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/Components/helpers/LazyVideo/LazyVideo.d.ts +4 -0
- package/dist/Components/utils/index.d.ts +1 -0
- package/dist/Components/utils/observeIntersection.d.ts +4 -0
- package/dist/Components/utils/useLazyVideos.d.ts +12 -0
- package/dist/Grid-BBpdl60K.js +374 -0
- package/dist/Grid-DS53S_gA.mjs +1576 -0
- package/dist/{Helix-BmkAKT1G.mjs → Helix-BPn9V1sg.mjs} +53 -53
- package/dist/{Helix-2Vr-9WBa.js → Helix-DcgsCc4D.js} +2 -2
- package/dist/{Hive-BGMWinrW.mjs → Hive-D6-R6TwM.mjs} +114 -111
- package/dist/Hive-n8Fz-j3o.js +321 -0
- package/dist/LazyVideo-CdAWymKO.mjs +15 -0
- package/dist/LazyVideo-imbU18js.js +1 -0
- package/dist/Marquee-DOIRRCu4.js +133 -0
- package/dist/Marquee-O_PDwlIb.mjs +564 -0
- package/dist/MarqueeText-DkaO2lQ5.js +132 -0
- package/dist/MarqueeText-Rzt2fJYt.mjs +517 -0
- package/dist/{Mercury-DuKJQ1Zo.mjs → Mercury-C9D10TTT.mjs} +55 -54
- package/dist/Mercury-DynO-NxY.js +267 -0
- package/dist/{PretextComponent-CGycuNNn.js → PretextComponent-BnsS2zJ6.js} +1 -1
- package/dist/{PretextComponent-DN8cyZ8x.mjs → PretextComponent-j-OsRZTx.mjs} +7 -7
- package/dist/Waterfall-DC2WQ3GT.js +287 -0
- package/dist/{Waterfall-A0FjM2my.mjs → Waterfall-Yud2VR62.mjs} +299 -295
- package/dist/{components-DTCDEBo0.js → components-B9Vdjf0w.js} +1 -1
- package/dist/{components-BFJINCME.mjs → components-D2LyuDm-.mjs} +1 -1
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +7 -7
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +2 -2
- package/dist/observeIntersection-B0f3L2iK.mjs +23 -0
- package/dist/observeIntersection-DxGj9Ctt.js +1 -0
- package/dist/sources.js +147 -59
- package/dist/sources.mjs +155 -67
- package/dist/useLazyVideos-CdCbc2j0.js +1 -0
- package/dist/useLazyVideos-CxXyEjRQ.mjs +52 -0
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +14 -12
- package/package.json +5 -3
- package/dist/Grid-CemGhf3F.js +0 -374
- package/dist/Grid-cfQsXW3b.mjs +0 -1553
- package/dist/Hive-BC6zQBsv.js +0 -321
- package/dist/Marquee-BYClHHws.mjs +0 -551
- package/dist/Marquee-vmHaTGIP.js +0 -133
- package/dist/MarqueeText-4Rip_sQX.mjs +0 -515
- package/dist/MarqueeText-E6OubMOG.js +0 -132
- package/dist/Mercury-BwF_XW2w.js +0 -267
- package/dist/Waterfall-DnPDHbCL.js +0 -287
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsxs as ce, Fragment as ie, jsx as h } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
2
|
+
import { useRef as V, useMemo as y, useEffect as Ee } from "react";
|
|
3
3
|
import { s as ae } from "./scalingValue-C9JH5L6O.mjs";
|
|
4
4
|
import { u as xe } from "./useScopedStyles-DhBG3557.mjs";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { L as Re } from "./LazyVideo-CdAWymKO.mjs";
|
|
6
|
+
const Te = 10, _e = 400, Se = 1, Fe = 1120 / 1440, Ae = 140 / 1440, we = 550 / 1440, Ne = 13, De = 4, $e = 38 / 100, Ce = 28 / 100, de = 2.8, Le = 0.9, fe = 0.22, He = 0.5, Pe = 1, Ue = 1.5, ge = 0, ze = 0.85;
|
|
7
|
+
function We(e) {
|
|
7
8
|
return `
|
|
8
9
|
.${e}-wrapper {
|
|
9
10
|
position: relative;
|
|
@@ -55,11 +56,11 @@ function le(e, t, o, r) {
|
|
|
55
56
|
const a = (typeof e == "string" ? Number(e) : e) ?? t;
|
|
56
57
|
return Number.isFinite(a) ? Math.min(r, Math.max(o, Math.round(a))) : t;
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
+
function j(e, t, o = 0, r = 9999) {
|
|
59
60
|
const a = (typeof e == "string" ? Number(e) : e) ?? t;
|
|
60
61
|
return Number.isFinite(a) ? Math.min(r, Math.max(o, a)) : t;
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
+
function Be(e) {
|
|
63
64
|
return typeof e == "string" ? {
|
|
64
65
|
display: e.toLowerCase() === "cover" ? "cover" : "fit",
|
|
65
66
|
ratioValue: "2:3",
|
|
@@ -70,11 +71,11 @@ function We(e) {
|
|
|
70
71
|
reversed: (e == null ? void 0 : e.reversed) ?? !1
|
|
71
72
|
};
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
+
function Ge(e) {
|
|
74
75
|
const [t, o] = e.ratioValue.split(":").map(Number), r = e.reversed ? o : t;
|
|
75
76
|
return (e.reversed ? t : o) / r;
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
+
function Ve(e) {
|
|
78
79
|
return e.type === "video" ? !0 : e.type === "image" ? !1 : /\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.name ?? "") || /\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.assetId ?? "");
|
|
79
80
|
}
|
|
80
81
|
function he(e, t) {
|
|
@@ -88,96 +89,96 @@ function je(e) {
|
|
|
88
89
|
}
|
|
89
90
|
return t || 1;
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
+
function ke(e, t) {
|
|
92
93
|
return e ? 1 : 1 + fe * (0.35 + t);
|
|
93
94
|
}
|
|
94
|
-
function
|
|
95
|
-
const n = t *
|
|
95
|
+
function Xe(e, t, o, r) {
|
|
96
|
+
const n = t * ke(o, r);
|
|
96
97
|
return Math.max(0, (e - n) / 2);
|
|
97
98
|
}
|
|
98
|
-
function
|
|
99
|
+
function Je(e, t, o) {
|
|
99
100
|
const r = he(e, o);
|
|
100
101
|
return {
|
|
101
102
|
offset: Math.sin(o) * r / t,
|
|
102
103
|
scale: r
|
|
103
104
|
};
|
|
104
105
|
}
|
|
105
|
-
function
|
|
106
|
+
function Ye(e, t, o) {
|
|
106
107
|
return e / 2 + t * o;
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
+
function Ze(e, t, o) {
|
|
109
110
|
return `translate(calc(${e(t)} - var(--helix-base-w) / 2), -50%) scale(${me(o)})`;
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
+
function qe(e) {
|
|
112
113
|
return Math.round(e * 1e3);
|
|
113
114
|
}
|
|
114
115
|
function pe(e, t, o) {
|
|
115
|
-
const r = Math.cos(e), n = Math.cos(
|
|
116
|
+
const r = Math.cos(e), n = Math.cos(ze * Math.PI / 2);
|
|
116
117
|
if (r >= n)
|
|
117
118
|
return o;
|
|
118
119
|
const a = (r + 1) / (n + 1);
|
|
119
120
|
return me(t + (o - t) * a);
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
+
function Ke(e) {
|
|
122
123
|
return pe(e, He, Pe);
|
|
123
124
|
}
|
|
124
|
-
function
|
|
125
|
-
return pe(e,
|
|
125
|
+
function Qe(e) {
|
|
126
|
+
return pe(e, Ue, ge);
|
|
126
127
|
}
|
|
127
|
-
function
|
|
128
|
+
function et(e, t) {
|
|
128
129
|
if (!t) return "none";
|
|
129
|
-
const o =
|
|
130
|
+
const o = Qe(e);
|
|
130
131
|
return o <= 0 ? "none" : `blur(${o}px)`;
|
|
131
132
|
}
|
|
132
133
|
function se(e, t) {
|
|
133
|
-
const o = t * Math.PI * 2, { offset: r, scale: n } =
|
|
134
|
+
const o = t * Math.PI * 2, { offset: r, scale: n } = Je(e.depthFactor, e.spreadFactor, o), a = Ye(e.width, e.orbitRadius, r);
|
|
134
135
|
return {
|
|
135
|
-
transform:
|
|
136
|
-
zIndex:
|
|
137
|
-
opacity:
|
|
138
|
-
filter:
|
|
136
|
+
transform: Ze(e.scaled, a, n),
|
|
137
|
+
zIndex: qe(n),
|
|
138
|
+
opacity: Ke(o),
|
|
139
|
+
filter: et(o, e.blurEnabled)
|
|
139
140
|
};
|
|
140
141
|
}
|
|
141
142
|
function be(e, t) {
|
|
142
143
|
return (e % t + t) % t;
|
|
143
144
|
}
|
|
144
|
-
function
|
|
145
|
+
function tt(e, t) {
|
|
145
146
|
return k(e, t) / t;
|
|
146
147
|
}
|
|
147
148
|
function k(e, t) {
|
|
148
149
|
return be(e, t);
|
|
149
150
|
}
|
|
150
|
-
function
|
|
151
|
+
function ot(e, t) {
|
|
151
152
|
return Math.floor(e / t);
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
-
return
|
|
154
|
+
function rt(e, t, o, r) {
|
|
155
|
+
return ot(e, t) * o + k(e, t) * r;
|
|
155
156
|
}
|
|
156
157
|
function ue(e) {
|
|
157
158
|
const t = Math.sin(e * 12.9898) * 43758.5453;
|
|
158
159
|
return t - Math.floor(t);
|
|
159
160
|
}
|
|
160
|
-
function
|
|
161
|
+
function H(e) {
|
|
161
162
|
const t = e % 1;
|
|
162
163
|
return t < 0 ? t + 1 : t;
|
|
163
164
|
}
|
|
164
|
-
function
|
|
165
|
+
function nt(e, t, o) {
|
|
165
166
|
const r = t / de, n = o === "left" ? -e * r : e * r;
|
|
166
|
-
return
|
|
167
|
+
return H(n);
|
|
167
168
|
}
|
|
168
|
-
function
|
|
169
|
+
function dt({
|
|
169
170
|
settings: e,
|
|
170
171
|
content: t,
|
|
171
172
|
isEditor: o,
|
|
172
173
|
isPreviewMode: r
|
|
173
174
|
}) {
|
|
174
|
-
const { prefix: n } = xe(), a =
|
|
175
|
+
const { prefix: n } = xe(), a = V(null), M = j(
|
|
175
176
|
(e == null ? void 0 : e.width) ?? (e == null ? void 0 : e.spread) ?? (e == null ? void 0 : e.wrapperWidth),
|
|
176
|
-
|
|
177
|
-
), _ =
|
|
178
|
-
() =>
|
|
177
|
+
Fe
|
|
178
|
+
), _ = j(e == null ? void 0 : e.imageWidth, Ae), P = j(e == null ? void 0 : e.turnHeight, we), f = le(e == null ? void 0 : e.itemsPerTurn, Ne, 3, 40), U = le(e == null ? void 0 : e.turns, De, 1, 30), S = Math.min(Le, Math.max(0, $e)), E = Math.min(1, Math.max(0, Ce)), F = Math.max(0, (e == null ? void 0 : e.speed) ?? de), g = (e == null ? void 0 : e.direction) === "left" ? "left" : "right", X = (e == null ? void 0 : e.playback) === "scroll" ? "scroll" : "autoplay", J = (e == null ? void 0 : e.cornerRadius) ?? 0, Y = (e == null ? void 0 : e.blur) !== "off", Z = y(() => Be(e == null ? void 0 : e.imageDisplay), [e == null ? void 0 : e.imageDisplay]), p = Z.display === "cover", b = (i) => ae(i, o ?? !1), q = y(() => je(S), [S]), K = y(
|
|
179
|
+
() => Xe(M, _, p, E),
|
|
179
180
|
[M, _, p, E]
|
|
180
|
-
), Q = y(() =>
|
|
181
|
+
), Q = y(() => We(n), [n]), z = y(
|
|
181
182
|
() => ({
|
|
182
183
|
scaled: (i) => ae(i, o ?? !1),
|
|
183
184
|
width: M,
|
|
@@ -187,14 +188,14 @@ function st({
|
|
|
187
188
|
blurEnabled: Y
|
|
188
189
|
}),
|
|
189
190
|
[o, M, K, S, q, Y]
|
|
190
|
-
), ee =
|
|
191
|
+
), ee = V([]), x = V(0), A = y(
|
|
191
192
|
() => (t ?? []).filter((i) => {
|
|
192
193
|
var s;
|
|
193
194
|
return !!((s = i.image) != null && s.assetId);
|
|
194
195
|
}),
|
|
195
196
|
[t]
|
|
196
|
-
), W =
|
|
197
|
-
() => Array.from({ length: ne }, (i, s) =>
|
|
197
|
+
), W = P / f, ve = _ * Ge(Z), ye = Math.min(_e, U * f), w = Se * f, te = ye + w * 2, Me = Math.max(0, U - 1) * P + (f - 1) * W, oe = F > 0, N = X === "scroll" && oe, D = X === "autoplay" && oe && (o ? !!r : !0), re = D ? 360 / (F * Te) : 0, ne = A.length === 0 ? 0 : te, B = y(
|
|
198
|
+
() => Array.from({ length: ne }, (i, s) => tt(s - w, f)),
|
|
198
199
|
[ne, w, f]
|
|
199
200
|
);
|
|
200
201
|
Ee(() => {
|
|
@@ -205,7 +206,7 @@ function st({
|
|
|
205
206
|
x.current = c, B.forEach((l, O) => {
|
|
206
207
|
const d = ee.current[O];
|
|
207
208
|
if (!d) return;
|
|
208
|
-
const u = se(z,
|
|
209
|
+
const u = se(z, H(l + c));
|
|
209
210
|
d.style.transform = u.transform, d.style.zIndex = String(u.zIndex), d.style.opacity = String(u.opacity), d.style.filter = u.filter;
|
|
210
211
|
});
|
|
211
212
|
};
|
|
@@ -213,8 +214,8 @@ function st({
|
|
|
213
214
|
const c = i.ownerDocument.defaultView ?? window, l = () => {
|
|
214
215
|
const d = i.getBoundingClientRect(), u = c.innerHeight || i.ownerDocument.documentElement.clientHeight, T = u + d.height;
|
|
215
216
|
if (T <= 0) return;
|
|
216
|
-
const
|
|
217
|
-
s(
|
|
217
|
+
const L = Math.min(1, Math.max(0, (u - d.top) / T));
|
|
218
|
+
s(nt(L, F, g));
|
|
218
219
|
};
|
|
219
220
|
l(), c.addEventListener("scroll", l, { passive: !0, capture: !0 }), c.addEventListener("resize", l);
|
|
220
221
|
const O = new ResizeObserver(l);
|
|
@@ -227,7 +228,7 @@ function st({
|
|
|
227
228
|
const R = (c) => {
|
|
228
229
|
if (m !== null) {
|
|
229
230
|
const l = (c - m) / 1e3 / re * I;
|
|
230
|
-
x.current =
|
|
231
|
+
x.current = H(x.current + l);
|
|
231
232
|
}
|
|
232
233
|
m = c, s(x.current), v = requestAnimationFrame(R);
|
|
233
234
|
}, G = () => {
|
|
@@ -257,21 +258,21 @@ function st({
|
|
|
257
258
|
height: b(Me)
|
|
258
259
|
},
|
|
259
260
|
children: Array.from({ length: te }, (i, s) => {
|
|
260
|
-
const I = s - w, m = A[be(I, A.length)].image, R = k(I, f), G = B[s], $ =
|
|
261
|
+
const I = s - w, m = A[be(I, A.length)].image, R = k(I, f), G = B[s], $ = rt(I, f, P, W), C = E === 0 ? 0 : (ue(R + 7.3) - 0.5) * E * W, c = p ? 1 : 1 + (ue(R + 3.1) - 0.5) * 2 * fe * (0.35 + E), l = _ * c, O = {
|
|
261
262
|
"--helix-base-w": b(l),
|
|
262
263
|
...p ? { "--helix-base-h": b(ve) } : {}
|
|
263
264
|
}, d = {
|
|
264
265
|
top: b($ + C),
|
|
265
266
|
...O,
|
|
266
|
-
...se(z,
|
|
267
|
+
...se(z, H(G + Ie))
|
|
267
268
|
}, u = J > 0 ? { borderRadius: b(J) } : {}, T = p ? {
|
|
268
269
|
...u,
|
|
269
270
|
width: "100%",
|
|
270
271
|
height: "100%",
|
|
271
272
|
objectFit: "cover",
|
|
272
273
|
objectPosition: "center"
|
|
273
|
-
} : u,
|
|
274
|
-
|
|
274
|
+
} : u, L = Ve(m) ? /* @__PURE__ */ h(
|
|
275
|
+
Re,
|
|
275
276
|
{
|
|
276
277
|
className: `${n}-media`,
|
|
277
278
|
style: T,
|
|
@@ -279,8 +280,7 @@ function st({
|
|
|
279
280
|
muted: !0,
|
|
280
281
|
loop: !0,
|
|
281
282
|
autoPlay: !0,
|
|
282
|
-
playsInline: !0
|
|
283
|
-
preload: "auto"
|
|
283
|
+
playsInline: !0
|
|
284
284
|
}
|
|
285
285
|
) : /* @__PURE__ */ h(
|
|
286
286
|
"img",
|
|
@@ -301,7 +301,7 @@ function st({
|
|
|
301
301
|
},
|
|
302
302
|
className: p ? `${n}-item ${n}-item-cover` : `${n}-item`,
|
|
303
303
|
style: d,
|
|
304
|
-
children: p ? /* @__PURE__ */ h("div", { className: `${n}-cover`, style: u, children:
|
|
304
|
+
children: p ? /* @__PURE__ */ h("div", { className: `${n}-cover`, style: u, children: L }) : L
|
|
305
305
|
},
|
|
306
306
|
`${U}-${f}-${I}`
|
|
307
307
|
);
|
|
@@ -311,5 +311,5 @@ function st({
|
|
|
311
311
|
] });
|
|
312
312
|
}
|
|
313
313
|
export {
|
|
314
|
-
|
|
314
|
+
dt as Helix
|
|
315
315
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),f=require("react"),ne=require("./scalingValue-CSHYgTZl.js"),Me=require("./useScopedStyles-Bf6yohVQ.js"),xe=
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),f=require("react"),ne=require("./scalingValue-CSHYgTZl.js"),Me=require("./useScopedStyles-Bf6yohVQ.js"),xe=require("./LazyVideo-imbU18js.js"),Ie=10,Oe=400,Re=1,Ee=1120/1440,Se=140/1440,Te=550/1440,_e=13,Fe=4,Ae=38/100,we=28/100,se=2.8,Ne=.9,le=.22,De=.5,$e=1,Ce=1.5,He=0,Le=.85;function Pe(e){return`
|
|
2
2
|
.${e}-wrapper {
|
|
3
3
|
position: relative;
|
|
4
4
|
box-sizing: border-box;
|
|
@@ -40,4 +40,4 @@
|
|
|
40
40
|
object-fit: cover;
|
|
41
41
|
object-position: center;
|
|
42
42
|
}
|
|
43
|
-
`}function ue(e){return Number(e.toFixed(4))}function ce(e,t,o,r){const a=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(a)?Math.min(r,Math.max(o,Math.round(a))):t}function
|
|
43
|
+
`}function ue(e){return Number(e.toFixed(4))}function ce(e,t,o,r){const a=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(a)?Math.min(r,Math.max(o,Math.round(a))):t}function B(e,t,o=0,r=9999){const a=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(a)?Math.min(r,Math.max(o,a)):t}function ge(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function Ue(e){const[t,o]=e.ratioValue.split(":").map(Number),r=e.reversed?o:t;return(e.reversed?t:o)/r}function je(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.name??"")||/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.assetId??"")}function de(e,t){return(1-e)/(1-e*Math.cos(t))}function ze(e){let t=0;for(let o=0;o<360;o+=1){const r=o*Math.PI/180;t=Math.max(t,Math.abs(Math.sin(r)*de(e,r)))}return t||1}function We(e,t){return e?1:1+le*(.35+t)}function Ve(e,t,o,r){const n=t*We(o,r);return Math.max(0,(e-n)/2)}function Be(e,t,o){const r=de(e,o);return{offset:Math.sin(o)*r/t,scale:r}}function Ge(e,t,o){return e/2+t*o}function qe(e,t,o){return`translate(calc(${e(t)} - var(--helix-base-w) / 2), -50%) scale(${ue(o)})`}function ke(e){return Math.round(e*1e3)}function fe(e,t,o){const r=Math.cos(e),n=Math.cos(Le*Math.PI/2);if(r>=n)return o;const a=(r+1)/(n+1);return ue(t+(o-t)*a)}function Xe(e){return fe(e,De,$e)}function Je(e){return fe(e,Ce,He)}function Ye(e,t){if(!t)return"none";const o=Je(e);return o<=0?"none":`blur(${o}px)`}function ie(e,t){const o=t*Math.PI*2,{offset:r,scale:n}=Be(e.depthFactor,e.spreadFactor,o),a=Ge(e.width,e.orbitRadius,r);return{transform:qe(e.scaled,a,n),zIndex:ke(n),opacity:Xe(o),filter:Ye(o,e.blurEnabled)}}function me(e,t){return(e%t+t)%t}function Ze(e,t){return G(e,t)/t}function G(e,t){return me(e,t)}function Ke(e,t){return Math.floor(e/t)}function Qe(e,t,o,r){return Ke(e,t)*o+G(e,t)*r}function ae(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function L(e){const t=e%1;return t<0?t+1:t}function et(e,t,o){const r=t/se,n=o==="left"?-e*r:e*r;return L(n)}function tt({settings:e,content:t,isEditor:o,isPreviewMode:r}){const{prefix:n}=Me.useScopedStyles(),a=f.useRef(null),M=B((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),Ee),T=B(e==null?void 0:e.imageWidth,Se),P=B(e==null?void 0:e.turnHeight,Te),h=ce(e==null?void 0:e.itemsPerTurn,_e,3,40),g=ce(e==null?void 0:e.turns,Fe,1,30),_=Math.min(Ne,Math.max(0,Ae)),O=Math.min(1,Math.max(0,we)),F=Math.max(0,(e==null?void 0:e.speed)??se),U=(e==null?void 0:e.direction)==="left"?"left":"right",q=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",k=(e==null?void 0:e.cornerRadius)??0,X=(e==null?void 0:e.blur)!=="off",J=f.useMemo(()=>ge(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),b=J.display==="cover",v=i=>ne.scalingValue(i,o??!1),Y=f.useMemo(()=>ze(_),[_]),Z=f.useMemo(()=>Ve(M,T,b,O),[M,T,b,O]),K=f.useMemo(()=>Pe(n),[n]),j=f.useMemo(()=>({scaled:i=>ne.scalingValue(i,o??!1),width:M,orbitRadius:Z,depthFactor:_,spreadFactor:Y,blurEnabled:X}),[o,M,Z,_,Y,X]),Q=f.useRef([]),R=f.useRef(0),A=f.useMemo(()=>(t??[]).filter(i=>{var u;return!!((u=i.image)!=null&&u.assetId)}),[t]),z=P/h,he=T*Ue(J),pe=Math.min(Oe,g*h),w=Re*h,ee=pe+w*2,be=Math.max(0,g-1)*P+(h-1)*z,te=F>0,N=q==="scroll"&&te,D=q==="autoplay"&&te&&(o?!!r:!0),oe=D?360/(F*Ie):0,re=A.length===0?0:ee,W=f.useMemo(()=>Array.from({length:re},(i,u)=>Ze(u-w,h)),[re,w,h]);f.useEffect(()=>{if(!D&&!N)return;const i=a.current;if(!i)return;const u=c=>{R.current=c,W.forEach((s,I)=>{const m=Q.current[I];if(!m)return;const d=ie(j,L(s+c));m.style.transform=d.transform,m.style.zIndex=String(d.zIndex),m.style.opacity=String(d.opacity),m.style.filter=d.filter})};if(N){const c=i.ownerDocument.defaultView??window,s=()=>{const m=i.getBoundingClientRect(),d=c.innerHeight||i.ownerDocument.documentElement.clientHeight,S=d+m.height;if(S<=0)return;const H=Math.min(1,Math.max(0,(d-m.top)/S));u(et(H,F,U))};s(),c.addEventListener("scroll",s,{passive:!0,capture:!0}),c.addEventListener("resize",s);const I=new ResizeObserver(s);return I.observe(i),()=>{c.removeEventListener("scroll",s,{capture:!0}),c.removeEventListener("resize",s),I.disconnect()}}const x=U==="left"?-1:1;let y=null,p=null;const E=c=>{if(p!==null){const s=(c-p)/1e3/oe*x;R.current=L(R.current+s)}p=c,u(R.current),y=requestAnimationFrame(E)},V=()=>{y===null&&(p=null,y=requestAnimationFrame(E))},$=()=>{y!==null&&cancelAnimationFrame(y),y=null},C=new IntersectionObserver(([c])=>{c!=null&&c.isIntersecting?V():$()});return C.observe(i),()=>{$(),C.disconnect()}},[D,N,W,j,oe,F,U]);const ve=D||N?R.current:0;return A.length===0?l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:K}}),l.jsx("div",{className:`${n}-wrapper`,style:{width:v(M)}})]}):l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:K}}),l.jsx("div",{ref:a,className:`${n}-wrapper`,style:{width:v(M),height:v(be)},children:Array.from({length:ee},(i,u)=>{const x=u-w,p=A[me(x,A.length)].image,E=G(x,h),V=W[u],$=Qe(x,h,P,z),C=O===0?0:(ae(E+7.3)-.5)*O*z,c=b?1:1+(ae(E+3.1)-.5)*2*le*(.35+O),s=T*c,I={"--helix-base-w":v(s),...b?{"--helix-base-h":v(he)}:{}},m={top:v($+C),...I,...ie(j,L(V+ve))},d=k>0?{borderRadius:v(k)}:{},S=b?{...d,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:d,H=je(p)?l.jsx(xe.LazyVideo,{className:`${n}-media`,style:S,src:p.assetId,muted:!0,loop:!0,autoPlay:!0,playsInline:!0}):l.jsx("img",{className:`${n}-media`,style:S,src:p.assetId,alt:p.name??"",loading:"lazy",decoding:"async"});return l.jsx("div",{ref:ye=>{Q.current[u]=ye},className:b?`${n}-item ${n}-item-cover`:`${n}-item`,style:m,children:b?l.jsx("div",{className:`${n}-cover`,style:d,children:H}):H},`${g}-${h}-${x}`)})})]})}exports.Helix=tt;
|